{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}H:\DNB\met Rick Dutch FDI\REStat replication\output.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 2 Aug 2013, 15:17:30
{txt}
{com}. 
. version
{txt}version 12.1

{com}. update 

{txt}Update status
    Last check for updates:  {hilite:02 Aug 2013}
    New update available:    {hilite:none}         (as of 02 Aug 2013)
    Current update level:    {hilite:09 Jul 2013}  {help whatsnew:(what's new)}

Possible actions

    {stata update query:Check for available updates}           (or type -update query-)

{com}. 
. run "$path\spatreg2.ado"
{txt}
{com}. 
. capture noisily ssc inst vincenty
{txt}checking {hilite:vincenty} consistency and verifying not already installed...
all files already exist and are up to date.

{com}. capture noisily ssc inst subsave
{txt}checking {hilite:subsave} consistency and verifying not already installed...
all files already exist and are up to date.

{com}. capture noisily net inst http://www.stata.com/stb/stb60/sg162
checking {hilite:sg162} consistency and verifying not already installed...
all files already exist and are up to date.
{txt}
{com}. capture noisily net inst http://www.stata.com/users/vwiggins/grc1leg
checking {hilite:grc1leg} consistency and verifying not already installed...
all files already exist and are up to date.
{txt}
{com}. capture noisily ssc inst pescadf
{txt}checking {hilite:pescadf} consistency and verifying not already installed...
all files already exist and are up to date.

{com}. capture noisily net inst http://www.ats.ucla.edu/stat/stata/ado/analysis/hilo
checking {hilite:hilo} consistency and verifying not already installed...
all files already exist and are up to date.
{txt}
{com}. capture noisily net inst http://www.stata-journal.com/software/sj5-4/dm88_1
checking {hilite:dm88_1} consistency and verifying not already installed...
all files already exist and are up to date.
{txt}
{com}. 
. capture noisily which spatreg2
{err}command spatreg2 not found as either built-in or ado-file
{txt}
{com}. capture noisily which vincenty
{txt}c:\ado\plus\v\vincenty.ado
{res}*! Author: Austin Nichols
*! Version 1.0.3 15 Feb, 2007
*! Version 1.0.2 10 Apr, 2006
*! Version 1.0.1  1 Aug, 2005
*! Version 1.0 sometime in 2004
*! ..Purpose:
*! vincenty is used for calculating geodesic distances 
*! between a pair of points on the surface of the Earth
*! (specified in signed decimal degrees latitude and longitude),
*! using an accurate ellipsoidal model of the Earth.
*! see http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
*! ..Acknowledgements:
*! The program is named for Thaddeus Vincenty who wrote
*! "Direct and Inverse Solutions of Geodesics on the Ellipsoid 
*! with application of nested equations" but the code
*! borrows extensively from Javascript code at
*! http://www.movable-type.co.uk/scripts/LatLongVincenty.html
*! [accessed 1 Aug, 2005].
*! ..Limitations:
*! The calculations are accurate to insane precision
*! assuming elevation above the ellipsoid is zero, so the
*! real 3D distance could differ substantially.
*! Note that elevation, even if available, cannot be
*! included in these calculations. 
*! The calculations fail if distance is close to a quarter
*! of the Earth's circumference, or if it is close to zero,
*! where the trig functions tax the limits of
*! machine precision.
{txt}
{com}. capture noisily which subsave
{txt}c:\ado\plus\s\subsave.ado
{res}*! Author: Roger Newson
*! Date: 30 November 2005
{txt}
{com}. capture noisily which spatwmat
{txt}c:\ado\plus\s\spatwmat.ado
{res}*! Version 1.0 - 29 January 2001 STB-60 sg162
*! -spatwmat- Generates different kinds of spatial weights matrices            
*! Author: Maurizio Pisati                                                     
*! Department of Sociology and Social Research                                 
*! University of Milano Bicocca (Italy)                                        
*! maurizio.pisati@galactica.it                                                
*!                                                                             
{txt}
{com}. capture noisily which grc1leg
{txt}c:\ado\plus\g\grc1leg.ado
{res}*! version 1.0.5  02jun2010
{txt}
{com}. capture noisily which pescadf
{txt}c:\ado\plus\p\pescadf.ado
{res}*! version 1.0.3     20071008     Piotr Lewandowski
*! Inspired by C. F. Baum's & F. Bornhorst's -ipshin-
*! Critical values matrices expanded to 9x9 dimension, thanks to Werner Hoelzl
{txt}
{com}. capture noisily which hilo
{txt}c:\ado\plus\h\hilo.ado

{com}. capture noisily which renvars
{txt}c:\ado\plus\r\renvars.ado
{res}*! 2.4.0  22aug2005  njc
*! 2.3.0  01feb2001  njc/jw  STB-60 dm88
{txt}
{com}. 
. use "$path\data.dta"
{txt}
{com}. 
. 
. // create resource variables 
.         egen restotdum= rowtotal(bauxite copper lead nickel phosphate tin zinc gold silver ironore hardcoal browncoal oil naturalgas)
{txt}
{com}.         replace restotdum=1 if restotdum>0 & restotdum!=.
{txt}(2804 real changes made)

{com}.         egen restotval= rowtotal(bauxite copper lead nickel phosphate tin zinc gold silver ironore hardcoal browncoal oil naturalgas)
{txt}
{com}.         label var restotdum "Reserves dummy, total (WB2000)"
{txt}
{com}.         label var restotval "Reserves value, total (WB2000)"
{txt}
{com}.         gen lnrestotval=ln(restotval)
{txt}(1612 missing values generated)

{com}.         label var lnrestotval "log Reserves value, total (WB2000)"
{txt}
{com}. 
.         egen resnotendum= rowtotal(bauxite copper lead nickel phosphate tin zinc gold silver ironore)
{txt}
{com}.         egen resnotenval= rowtotal(bauxite copper lead nickel phosphate tin zinc gold silver ironore)
{txt}
{com}.         replace resnotendum=1 if resnotendum>0 & resnotendum!=.
{txt}(2199 real changes made)

{com}.         label var resnotendum "Reserves dummy, total net of oil, gas & coal (WB2000)"
{txt}
{com}.         label var resnotenval "Reserves value, total net of oil, gas & coal (WB2000)"
{txt}
{com}.         gen lnresnotenval=ln(resnotenval)
{txt}(2217 missing values generated)

{com}.         label var lnresnotenval "log Reserves value, total net of oil, gas & coal (WB2000)"
{txt}
{com}. 
.         egen resendum= rowtotal(hardcoal browncoal oil naturalgas)
{txt}
{com}.         replace resendum=1 if resendum>0 &resendum!=.
{txt}(2208 real changes made)

{com}.         label var resendum "Reserves dummy, oil, gas & coal (WB2000)"
{txt}
{com}.         egen resenval= rowtotal(hardcoal browncoal oil naturalgas)
{txt}
{com}.         label var resenval "Reserves value, oil, gas & coal (WB2000)"
{txt}
{com}.         gen lnresenval=ln(resenval)
{txt}(2208 missing values generated)

{com}.         label var lnresenval "log Reserves value, oil, gas & coal (WB2000)"
{txt}
{com}. 
.         egen resenbpval=rowtotal(oilres gasres coalres)
{txt}
{com}.         label var resenbpval "Oil, gas & coal reserve BTU (BP/EIA, rowtotal)"
{txt}
{com}.         gen lnresenbpval=ln(resenbpval)
{txt}(2598 missing values generated)

{com}.         label var lnresenbpval "log Oil, gas & coal reserve BTU (BP/EIA, rowtotal)"
{txt}
{com}. 
.         sort idcode year
{txt}
{com}.         qui foreach var of varlist resendum restotdum resnotendum resenbpval restotval resenval resnotenval lnresenbpval lnrestotval lnresenval lnresnotenval {c -(}
{txt}
{com}. 
.         label var l1restotdum "Total resource dummy (t-1)"
{txt}
{com}.         label var l1resendum "Hydrocarbon resource dummy (t-1)"
{txt}
{com}.         label var l1resnotendum "Other mineral resource dummy (t-1)"
{txt}
{com}.         label var l1lnresenval "ln Hydrocarbon resource rents (t-1)" 
{txt}
{com}.         label var l1lnresnotenval "ln Other mineral resource rents (t-1)"
{txt}
{com}.         label var l1lnresenbpval "ln Hydrocarbon reserves in BTU (t-1)"
{txt}
{com}.         label var oilprice_usd2008 "Oil Price (constant 2008 USD)"
{txt}
{com}. 
. // FTA with Netherlands
.         gen ftaned=0
{txt}
{com}.         label var ftaned "FTA with Netherlands, Baier Bergstrand JIE 2007"
{txt}
{com}. 
.         *EU & EFTA
.         replace ftaned=1 if year>=1958 & wbcode=="BEL"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1958 & wbcode=="LUX"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1958 & wbcode=="FRA"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1958 & wbcode=="ITA"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1958 & wbcode=="DEU"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1960 & wbcode=="DNK"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1973 & wbcode=="IRL"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1960 & wbcode=="GBR"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1981 & wbcode=="GRC"
{txt}(22 real changes made)

{com}.         replace ftaned=1 if year>=1960 & wbcode=="PRT"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1986 & wbcode=="ESP"
{txt}(17 real changes made)

{com}.         replace ftaned=1 if year>=1960 & wbcode=="AUT"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1986 & wbcode=="FIN"
{txt}(17 real changes made)

{com}.         replace ftaned=1 if year>=1960 & wbcode=="SWE"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1960 & wbcode=="NOR"
{txt}(23 real changes made)

{com}.         replace ftaned=1 if year>=1960 & wbcode=="CHE"
{txt}(23 real changes made)

{com}. 
.         replace ftaned=1 if year>=1993 & wbcode=="ISR"
{txt}(10 real changes made)

{com}.         replace ftaned=1 if year>=1993 & wbcode=="BGR"
{txt}(10 real changes made)

{com}.         replace ftaned=1 if year>=1994 & wbcode=="HUN"
{txt}(9 real changes made)

{com}.         replace ftaned=1 if year>=1994 & wbcode=="POL"
{txt}(9 real changes made)

{com}.         replace ftaned=1 if year>=1993 & wbcode=="ROM"
{txt}(10 real changes made)

{com}. 
.         replace ftaned=1 if year>=2000 & wbcode=="MEX"
{txt}(3 real changes made)

{com}.         label var ftaned "FTA with Netherlands" 
{txt}
{com}. 
. // real exchange rate with NL
.         gen temp=pwt_p if wbcode=="NLD"
{txt}(4393 missing values generated)

{com}.         bys t: egen pwt_pNL= max(temp)
{txt}
{com}.         drop temp
{txt}
{com}.         gen rernlgdp = pwt_p/pwt_pNL
{txt}(605 missing values generated)

{com}.         drop pwt_pNL
{txt}
{com}.         label var rernlgdp "Real exchange rate with NL based on GDP price level
{txt}
{com}. 
. 
. 
. // Figure 1
. 
.                 preserve
{txt}
{com}.                 sort t
{txt}
{com}.                 by t: egen totaloutres =total(fdires/1000)
{txt}
{com}.                 label var totaloutres "Total Outward Resource FDI"
{txt}
{com}.                 by t: egen totaloutnores =total(fdinores/1000)
{txt}
{com}.                 label var totaloutnores "Total Outward Non-Resource FDI"
{txt}
{com}.                 #delimit ;
{txt}delimiter now ;
{com}.                 twoway  (line totaloutres t, lpattern(dash) lcolor(black) lwidth(medthick)) 
>                                 (line totaloutnores t, lpattern(dot) lcolor(black) lwidth(medthick)) 
>                                 (line gdp t, lpattern(solid) lcolor(black) lwidth(medthick))
>                                 if country=="Netherlands" & t>=1984
>                                 , legend(cols(1) label(3 "GDP, The Netherlands"))
>                                 xtitle(Year) ytitle("$ bn, 2000")
>                                 ;
{res}{txt}
{com}.                 graph save "$path\figure1" , asis replace ;
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\figure1.gph saved

{com}.                 restore;
{txt}
{com}.                 # delimit cr
{txt}delimiter now cr
{com}. 
. 
. // Table 1
. 
.                 table region year if (year==1984 | year==2002) & fdires>0 , c(sum fdires ) format(%9.0f) row

{txt}{hline 30}{c TT}{hline 13}
                              {c |}     year    
                       region {c |}  1984   2002
{hline 30}{c +}{hline 13}
          East Asia & Pacific {c |}   {res}624   5095
{txt}Eastern Europe & Central Asia {c |}    {res}86   1269
    {txt}Latin America & Caribbean {c |}   {res}955   3877
   {txt}Middle East & North Africa {c |}   {res}917   2169
                {txt}North America {c |} {res}15016   8006
                   {txt}South Asia {c |}    {res}16    553
           {txt}Sub-Saharan Africa {c |}   {res}298   3414
               {txt}Western Europe {c |}  {res}4048  20350
                              {txt}{c |} 
                        Total {c |} {res}21960  44733
{txt}{hline 30}{c BT}{hline 13}

{com}. 
.                 table region year if (year==1984 | year==2002) & fdinores>0 , c(sum fdinores ) format(%9.0f) row

{txt}{hline 30}{c TT}{hline 15}
                              {c |}      year     
                       region {c |}   1984    2002
{hline 30}{c +}{hline 15}
          East Asia & Pacific {c |}   {res}1722   18603
{txt}Eastern Europe & Central Asia {c |}     {res}46    8957
    {txt}Latin America & Caribbean {c |}   {res}3751   13023
   {txt}Middle East & North Africa {c |}    {res}251    1506
                {txt}North America {c |}   {res}9504   74296
                   {txt}South Asia {c |}     {res}52     642
           {txt}Sub-Saharan Africa {c |}    {res}247    1486
               {txt}Western Europe {c |}  {res}14814  188995
                              {txt}{c |} 
                        Total {c |}  {res}30387  307509
{txt}{hline 30}{c BT}{hline 15}

{com}. 
. 
. 
. // Tables 2 to 4
. 
.                 global lhs="lnfdinores"
{txt}
{com}.                 global extra= ""
{txt}
{com}.                 global clus =""
{txt}
{com}. 
.                 global rhs1 ="ln_poptot   lnhumanav   ln_dist  trend llngdppc lngdp_smp  rernlgdp govshare  "
{txt}
{com}.                 global w=1
{txt}
{com}.                 global ldv= "llnfdinores"
{txt}
{com}. 
. 
.                 *** panel unit root tests
.         preserve
{txt}
{com}.                 qui reg $lhs $rhs1  l1lnresenval
{txt}
{com}.                 keep if e(sample)
{txt}(3254 observations deleted)

{com}.                 tsreport, report panel list

{txt}Number of gaps in sample:  {res}13

{txt}Observations with preceding time gaps
{hline 10}{c TT}{hline 23}
   Record {c |}     idcode        year
{hline 10}{c +}{hline 23}
       83 {c |}         {res}15        1993
      {txt}122 {c |}         {res}17        2001
      {txt}152 {c |}         {res}24        1987
      {txt}213 {c |}         {res}33        1996
      {txt}509 {c |}         {res}88        1992
      {txt}510 {c |}         {res}88        1995
      {txt}512 {c |}         {res}88        1998
      {txt}514 {c |}         {res}88        2001
      {txt}661 {c |}        {res}102        2002
      {txt}703 {c |}        {res}131        1991
      {txt}880 {c |}        {res}158        1998
     {txt}1110 {c |}        {res}203        1987
     {txt}1112 {c |}        {res}203        1990
{txt}{hline 10}{c BT}{hline 23}

{com}.                         drop if idcode==15
{txt}(13 observations deleted)

{com}.                         drop if idcode==17 & t>=2001
{txt}(2 observations deleted)

{com}.                         drop if idcode==24 & t<1987
{txt}(2 observations deleted)

{com}.                         drop if idcode==33
{txt}(18 observations deleted)

{com}.                         drop if idcode==88
{txt}(8 observations deleted)

{com}.                         drop if idcode==102 & t>=2002
{txt}(1 observation deleted)

{com}.                         drop if idcode==131 & t<1991
{txt}(3 observations deleted)

{com}.                         drop if idcode==158 & t>=1998
{txt}(5 observations deleted)

{com}.                         drop if idcode==203 & t<1990
{txt}(3 observations deleted)

{com}. 
.                 sort idcode 
{txt}
{com}.                 by idcode: egen x = count(t)
{txt}
{com}.                 tab x

          {txt}x {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          3 {c |}{res}          6        0.54        0.54
{txt}          5 {c |}{res}          5        0.45        0.99
{txt}          7 {c |}{res}          7        0.63        1.63
{txt}          8 {c |}{res}         16        1.45        3.07
{txt}          9 {c |}{res}          9        0.81        3.88
{txt}         10 {c |}{res}         20        1.81        5.69
{txt}         11 {c |}{res}         11        0.99        6.68
{txt}         12 {c |}{res}         36        3.25        9.94
{txt}         13 {c |}{res}         26        2.35       12.29
{txt}         14 {c |}{res}         28        2.53       14.81
{txt}         15 {c |}{res}         60        5.42       20.23
{txt}         16 {c |}{res}         48        4.34       24.57
{txt}         18 {c |}{res}         18        1.63       26.20
{txt}         19 {c |}{res}        817       73.80      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,107      100.00
{txt}
{com}.                         drop if x<=5
{txt}(11 observations deleted)

{com}.                 sort idcode year
{txt}
{com}. 
.                 qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.                 subsave dij* using "$path\w.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w.dta saved

{com}.                 spatwmat using "$path\w.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}1096x1096


{txt}
{com}.                 matrix eigenvalues re im = w
{txt}
{com}.                 matrix e = re'
{txt}
{com}.                 mkmat $lhs, mat(y)
{res}{txt}
{com}.                 matrix yw=w*y
{txt}
{com}.                 svmat yw
{txt}
{com}. 
. // Table 3(a)
. 
.                 spatreg2 $lhs  $rhs1  l1lnresenval , robust w(w) e(e) model(lag)
{res}
{txt}initial:       log pseudolikelihood = {res}-1959.8212
{txt}rescale:       log pseudolikelihood = {res}-1959.8212
{txt}rescale eq:    log pseudolikelihood = {res}-1959.8212
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-1959.8212{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res} -1944.686{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-1944.2236{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-1944.2229{txt}  
Iteration 4:{col 16}log pseudolikelihood = {res}-1944.2229{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}      1096
{txt}{col 52}Variance ratio{col 68}={res}     0.799
{txt}{col 52}Squared corr.{col 68}={res}     0.802
{txt}Log likelihood = {res}-1944.2229{txt}{col 52}Sigma{col 68}={res}      1.42

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  lnfdinores{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores   {txt}{c |}
{space 3}ln_poptot {c |}{col 14}{res}{space 2} 1.165894{col 26}{space 2} .0409501{col 37}{space 1}   28.47{col 46}{space 3}0.000{col 54}{space 4} 1.085634{col 67}{space 3} 1.246155
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} 1.561743{col 26}{space 2} .1626819{col 37}{space 1}    9.60{col 46}{space 3}0.000{col 54}{space 4} 1.242892{col 67}{space 3} 1.880594
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2} -1.64322{col 26}{space 2} .0997288{col 37}{space 1}  -16.48{col 46}{space 3}0.000{col 54}{space 4}-1.838685{col 67}{space 3}-1.447756
{txt}{space 7}trend {c |}{col 14}{res}{space 2} .1363616{col 26}{space 2} .0140138{col 37}{space 1}    9.73{col 46}{space 3}0.000{col 54}{space 4}  .108895{col 67}{space 3} .1638282
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2} 1.183172{col 26}{space 2} .1111792{col 37}{space 1}   10.64{col 46}{space 3}0.000{col 54}{space 4} .9652646{col 67}{space 3} 1.401079
{txt}{space 3}lngdp_smp {c |}{col 14}{res}{space 2}-3.082836{col 26}{space 2} .2211867{col 37}{space 1}  -13.94{col 46}{space 3}0.000{col 54}{space 4}-3.516354{col 67}{space 3}-2.649318
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2}-.3685087{col 26}{space 2} .0437243{col 37}{space 1}   -8.43{col 46}{space 3}0.000{col 54}{space 4}-.4542066{col 67}{space 3}-.2828107
{txt}{space 4}govshare {c |}{col 14}{res}{space 2}-.0594227{col 26}{space 2} .0065713{col 37}{space 1}   -9.04{col 46}{space 3}0.000{col 54}{space 4}-.0723022{col 67}{space 3}-.0465433
{txt}l1lnresenval {c |}{col 14}{res}{space 2}-.1424892{col 26}{space 2} .0194364{col 37}{space 1}   -7.33{col 46}{space 3}0.000{col 54}{space 4}-.1805838{col 67}{space 3}-.1043945
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 14.58105{col 26}{space 2} 2.410782{col 37}{space 1}    6.05{col 46}{space 3}0.000{col 54}{space 4} 9.856007{col 67}{space 3}  19.3061
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .3647492     .06547     5.57   0.000{col 58} .2364303    .4930682
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50} 31.039{txt} ({res}0.000{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50} 33.250{txt} ({res}0.000{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60} 31.249{txt} ({res}0.000{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  4.152{txt} ({res}0.042{txt})

Acceptable range for rho: {res}-3.275 < rho < 1.000


{txt}
{com}.                 mat res=e(resid)
{txt}
{com}.                 svmat res, n(u)
{txt}
{com}. 
.                 gen cadfvar=""
{txt}(1096 missing values generated)

{com}.                 gen cadfz0=.
{txt}(1096 missing values generated)

{com}.                 gen cadfp0=.
{txt}(1096 missing values generated)

{com}.                 gen cadfz1=.
{txt}(1096 missing values generated)

{com}.                 gen cadfp1=.
{txt}(1096 missing values generated)

{com}. 
. // Table 2
.                 ** in levels
.                 local i=1
{txt}
{com}.                 qui foreach var of varlist $lhs  $rhs1 l1lnresenval yw1 {c -(}
{txt}
{com}.                 list cadf* if cadfvar!="", clean
{txt}
        {res}     cadfvar      cadfz0     cadfp0      cadfz1     cadfp1 {txt} 
   1.   {res}  lnfdinores   -1.864142   .0311509    .9197809   .8211564 {txt} 
   2.   {res}   ln_poptot   -7.013849   1.16e-12    .1196284   .5476112 {txt} 
   3.   {res}   lnhumanav    .6669061   .7475839    5.833951          1 {txt} 
   4.   {res}     ln_dist    32.74449          1    32.74449          1 {txt} 
   5.   {res}       trend    32.74449          1    32.74449          1 {txt} 
   6.   {res}    llngdppc    4.921388   .9999996    5.064468   .9999998 {txt} 
   7.   {res}   lngdp_smp   -2.657776   .0039329    2.197376   .9860032 {txt} 
   8.   {res}    rernlgdp   -.3306163   .3704672   -.9410744   .1733334 {txt} 
   9.   {res}    govshare   -1.007284   .1568992    .8917493   .8137363 {txt} 
  10.   {res}l1lnresenval   -.9124191   .1807741    1.964593   .9752693 {txt} 
  11.   {res}         yw1   -1.561879   .0591583    2.950457   .9984135 {txt} 

{com}. 
.                 ** in levels with a linear trend
.                 local i=1
{txt}
{com}.                 qui foreach var of varlist $lhs $ldv $rhs1 l1lnresenval yw1 {c -(}
{txt}
{com}.                 list cadf* if cadfvar!="", clean
{txt}
        {res}     cadfvar      cadfz0     cadfp0     cadfz1     cadfp1 {txt} 
   1.   {res}  lnfdinores    .8567129   .8041982   4.326533   .9999924 {txt} 
   2.   {res} llnfdinores    .6591257   .7450925   3.235489   .9993928 {txt} 
   3.   {res}   ln_poptot     10.4338          1   3.401645   .9996651 {txt} 
   4.   {res}   lnhumanav    3.763446   .9999162   10.51643          1 {txt} 
   5.   {res}     ln_dist    29.35694          1   29.35694          1 {txt} 
   6.   {res}       trend    29.35694          1   29.35694          1 {txt} 
   7.   {res}    llngdppc    2.762896   .9971355   2.211637   .9865041 {txt} 
   8.   {res}   lngdp_smp   -3.286353   .0005075    .905485   .8173957 {txt} 
   9.   {res}    rernlgdp    1.492665   .9322375   1.070861   .8578841 {txt} 
  10.   {res}    govshare     .342151   .6338814   1.508109   .9342367 {txt} 
  11.   {res}l1lnresenval   -2.674024   .0037474   .9376343   .8257838 {txt} 
  12.   {res}         yw1    .9548498   .8301732   5.443776          1 {txt} 

{com}. 
.                 ** in first difference
.                 local i=1
{txt}
{com}.                 qui foreach var of varlist $lhs $ldv $rhs1 l1lnresenval  yw1 {c -(}
{txt}
{com}.                 list cadf* if cadfvar!="", clean
{txt}
        {res}     cadfvar      cadfz0     cadfp0      cadfz1     cadfp1 {txt} 
   1.   {res}  lnfdinores   -16.22546          0   -3.315372   .0004576 {txt} 
   2.   {res} llnfdinores   -15.75182          0   -3.196692   .0006951 {txt} 
   3.   {res}   ln_poptot     5.81509          1    .0468613   .5186881 {txt} 
   4.   {res}   lnhumanav   -15.19807          0   -1.008015   .1567235 {txt} 
   5.   {res}     ln_dist    32.50396          1    32.50396          1 {txt} 
   6.   {res}       trend    32.50396          1    32.50396          1 {txt} 
   7.   {res}    llngdppc   -9.757762   8.54e-23   -2.412353    .007925 {txt} 
   8.   {res}   lngdp_smp   -10.46088   6.53e-26   -.6190032   .2679571 {txt} 
   9.   {res}    rernlgdp   -11.97668   2.35e-33   -2.093524   .0181512 {txt} 
  10.   {res}    govshare   -12.90997   1.98e-38   -3.851516   .0000587 {txt} 
  11.   {res}l1lnresenval   -18.54296          0   -4.900481   4.78e-07 {txt} 
  12.   {res}         yw1   -11.90996   5.25e-33   -2.551015   .0053705 {txt} 

{com}. 
. // Table 4
. 
.                 xtunitroot ips u1, lags(0)

{txt}Im-Pesaran-Shin unit-root test for {res}u1
{txt}{hline 37}
Ho: All panels contain unit roots{col 45}Number of panels{col 68}={col 69}{res}     65
{txt}Ha: Some panels are stationary{col 45}Avg. number of periods{col 68}={col 69}{res}  16.86

{txt}AR parameter: {res}Panel-specific{txt}{col 45}Asymptotics: {res}T,N -> Infinity
{txt}Panel means:  {res}Included{col 63}sequentially
{txt}Time trend:   {res}Not included

{txt}ADF regressions: {res}0{txt} lags
{hline 78}
{col 21}Statistic{col 36}p-value
{hline 78}
{col 2}W-t-bar{res}{col 21} -2.5093{col 37}0.0060
{txt}{hline 78}

{com}.                 xtunitroot ips u1, lags(1)

{txt}Im-Pesaran-Shin unit-root test for {res}u1
{txt}{hline 37}
Ho: All panels contain unit roots{col 45}Number of panels{col 68}={col 69}{res}     65
{txt}Ha: Some panels are stationary{col 45}Avg. number of periods{col 68}={col 69}{res}  16.86

{txt}AR parameter: {res}Panel-specific{txt}{col 45}Asymptotics: {res}T,N -> Infinity
{txt}Panel means:  {res}Included{col 63}sequentially
{txt}Time trend:   {res}Not included

{txt}ADF regressions: {res}1{txt} lags
{hline 78}
{col 21}Statistic{col 36}p-value
{hline 78}
{col 2}W-t-bar{res}{col 21} -2.5574{col 37}0.0053
{txt}{hline 78}

{com}.                 xtunitroot llc u1 if x==19, lags(0) nocons

{txt}Levin-Lin-Chu unit-root test for {res}u1
{txt}{hline 35}
Ho: Panels contain unit roots{col 45}Number of panels{col 63}={col 64}{res}     43
{txt}Ha: Panels are stationary{col 45}Number of periods{col 63}={col 64}{res}     19

{txt}AR parameter: {res}Common{txt}{col 45}Asymptotics: {res}root(N)/T -> 0
{txt}Panel means:  {res}Not included
{txt}Time trend:   {res}Not included

{txt}ADF regressions: {res}0{txt} lags
LR variance:     {res}Bartlett{txt} kernel, {res}8.00{txt} lags average (chosen by {res}LLC{txt})
{hline 78}
{col 21}Statistic{col 36}p-value
{hline 78}
{col 2}Unadjusted t{res}{col 21} -4.7736{col 37}0.0000
{txt}{col 2}Adjusted t*{res}{col 21} -4.5773{col 37}0.0000
{txt}{hline 78}

{com}.                 xtunitroot llc u1 if x==19, lags(1) nocons

{txt}Levin-Lin-Chu unit-root test for {res}u1
{txt}{hline 35}
Ho: Panels contain unit roots{col 45}Number of panels{col 63}={col 64}{res}     43
{txt}Ha: Panels are stationary{col 45}Number of periods{col 63}={col 64}{res}     19

{txt}AR parameter: {res}Common{txt}{col 45}Asymptotics: {res}root(N)/T -> 0
{txt}Panel means:  {res}Not included
{txt}Time trend:   {res}Not included

{txt}ADF regressions: {res}1{txt} lag
LR variance:     {res}Bartlett{txt} kernel, {res}8.00{txt} lags average (chosen by {res}LLC{txt})
{hline 78}
{col 21}Statistic{col 36}p-value
{hline 78}
{col 2}Unadjusted t{res}{col 21} -4.2406{col 37}0.0000
{txt}{col 2}Adjusted t*{res}{col 21} -4.0693{col 37}0.0000
{txt}{hline 78}

{com}. 
.                 
.                 
. // Table 3(b)
. 
.                 *** DOLS, or D-SAR
.                 sort idcode year
{txt}
{com}.                 foreach var of varlist ln_poptot lnhumanav  llngdppc lngdp_smp  rernlgdp govshare  l1lnresenval yw1 {c -(} 
{txt}  2{com}.                 gen d1l1`var'=dl.`var'
{txt}  3{com}.                 gen d1f1`var'=df.`var'
{txt}  4{com}.                 {c )-}
{txt}(130 missing values generated)
(65 missing values generated)
(130 missing values generated)
(65 missing values generated)
(130 missing values generated)
(65 missing values generated)
(130 missing values generated)
(65 missing values generated)
(130 missing values generated)
(65 missing values generated)
(130 missing values generated)
(65 missing values generated)
(130 missing values generated)
(65 missing values generated)
(130 missing values generated)
(65 missing values generated)

{com}. 
. 
.                 qui reg $lhs $rhs1  l1lnresenval d1l* d1f* yw1
{txt}
{com}.                 keep if e(sample)
{txt}(195 observations deleted)

{com}. 
.                 sort idcode year
{txt}
{com}. 
.                 qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.                 subsave dij* using "$path\w.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w.dta saved

{com}.                 spatwmat using "$path\w.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}901x901


{txt}
{com}.                 matrix eigenvalues re im = w
{txt}
{com}.                 matrix e = re'
{txt}
{com}.                 spatreg2 $lhs  $rhs1  l1lnresenval d1f1* d1l1*, robust w(w) e(e) model(lag)
{res}
{txt}initial:       log pseudolikelihood = {res}-1522.4536
{txt}rescale:       log pseudolikelihood = {res}-1522.4536
{txt}rescale eq:    log pseudolikelihood = {res}-1522.4536
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-1522.4536{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-1506.6319{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-1505.7447{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res} -1505.742{txt}  
Iteration 4:{col 16}log pseudolikelihood = {res} -1505.742{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}       901
{txt}{col 52}Variance ratio{col 68}={res}     0.825
{txt}{col 52}Squared corr.{col 68}={res}     0.828
{txt}Log likelihood = {res}-1505.742{txt}{col 52}Sigma{col 68}={res}      1.28

{txt}{hline 17}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 18}{c |}{col 30}    Robust
{col 1}      lnfdinores{col 18}{c |}      Coef.{col 30}   Std. Err.{col 42}      z{col 50}   P>|z|{col 58}     [95% Con{col 71}f. Interval]
{hline 17}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores       {txt}{c |}
{space 7}ln_poptot {c |}{col 18}{res}{space 2} 1.132248{col 30}{space 2} .0428627{col 41}{space 1}   26.42{col 50}{space 3}0.000{col 58}{space 4} 1.048238{col 71}{space 3} 1.216257
{txt}{space 7}lnhumanav {c |}{col 18}{res}{space 2} 1.727879{col 30}{space 2} .1653997{col 41}{space 1}   10.45{col 50}{space 3}0.000{col 58}{space 4} 1.403701{col 71}{space 3} 2.052056
{txt}{space 9}ln_dist {c |}{col 18}{res}{space 2}-1.655698{col 30}{space 2} .1081966{col 41}{space 1}  -15.30{col 50}{space 3}0.000{col 58}{space 4} -1.86776{col 71}{space 3}-1.443637
{txt}{space 11}trend {c |}{col 18}{res}{space 2} .1282506{col 30}{space 2} .0138462{col 41}{space 1}    9.26{col 50}{space 3}0.000{col 58}{space 4} .1011125{col 71}{space 3} .1553886
{txt}{space 8}llngdppc {c |}{col 18}{res}{space 2} 1.046939{col 30}{space 2} .1091885{col 41}{space 1}    9.59{col 50}{space 3}0.000{col 58}{space 4} .8329333{col 71}{space 3} 1.260944
{txt}{space 7}lngdp_smp {c |}{col 18}{res}{space 2}-3.039867{col 30}{space 2} .2309011{col 41}{space 1}  -13.17{col 50}{space 3}0.000{col 58}{space 4}-3.492425{col 71}{space 3}-2.587309
{txt}{space 8}rernlgdp {c |}{col 18}{res}{space 2} -.415749{col 30}{space 2} .0541329{col 41}{space 1}   -7.68{col 50}{space 3}0.000{col 58}{space 4}-.5218476{col 71}{space 3}-.3096504
{txt}{space 8}govshare {c |}{col 18}{res}{space 2}-.0654002{col 30}{space 2} .0069232{col 41}{space 1}   -9.45{col 50}{space 3}0.000{col 58}{space 4}-.0789695{col 71}{space 3} -.051831
{txt}{space 4}l1lnresenval {c |}{col 18}{res}{space 2}-.1436002{col 30}{space 2} .0214748{col 41}{space 1}   -6.69{col 50}{space 3}0.000{col 58}{space 4}-.1856901{col 71}{space 3}-.1015103
{txt}{space 3}d1f1ln_poptot {c |}{col 18}{res}{space 2}-1.517034{col 30}{space 2} 2.536541{col 41}{space 1}   -0.60{col 50}{space 3}0.550{col 58}{space 4}-6.488562{col 71}{space 3} 3.454495
{txt}{space 3}d1f1lnhumanav {c |}{col 18}{res}{space 2}-.7056041{col 30}{space 2}  1.17539{col 41}{space 1}   -0.60{col 50}{space 3}0.548{col 58}{space 4}-3.009326{col 71}{space 3} 1.598117
{txt}{space 4}d1f1llngdppc {c |}{col 18}{res}{space 2} .1617868{col 30}{space 2} 1.303607{col 41}{space 1}    0.12{col 50}{space 3}0.901{col 58}{space 4}-2.393236{col 71}{space 3} 2.716809
{txt}{space 3}d1f1lngdp_smp {c |}{col 18}{res}{space 2}-.1179201{col 30}{space 2} 2.376036{col 41}{space 1}   -0.05{col 50}{space 3}0.960{col 58}{space 4}-4.774865{col 71}{space 3} 4.539024
{txt}{space 4}d1f1rernlgdp {c |}{col 18}{res}{space 2} .1290657{col 30}{space 2} .1015979{col 41}{space 1}    1.27{col 50}{space 3}0.204{col 58}{space 4}-.0700624{col 71}{space 3} .3281939
{txt}{space 4}d1f1govshare {c |}{col 18}{res}{space 2} .0017103{col 30}{space 2} .0352868{col 41}{space 1}    0.05{col 50}{space 3}0.961{col 58}{space 4}-.0674506{col 71}{space 3} .0708713
{txt}d1f1l1lnresenval {c |}{col 18}{res}{space 2}-.0045807{col 30}{space 2} .0805559{col 41}{space 1}   -0.06{col 50}{space 3}0.955{col 58}{space 4}-.1624672{col 71}{space 3} .1533059
{txt}{space 9}d1f1yw1 {c |}{col 18}{res}{space 2}-.1701856{col 30}{space 2} .2070179{col 41}{space 1}   -0.82{col 50}{space 3}0.411{col 58}{space 4}-.5759331{col 71}{space 3}  .235562
{txt}{space 3}d1l1ln_poptot {c |}{col 18}{res}{space 2} 1.197532{col 30}{space 2} 2.871742{col 41}{space 1}    0.42{col 50}{space 3}0.677{col 58}{space 4}-4.430979{col 71}{space 3} 6.826044
{txt}{space 3}d1l1lnhumanav {c |}{col 18}{res}{space 2}-1.208811{col 30}{space 2} .9471998{col 41}{space 1}   -1.28{col 50}{space 3}0.202{col 58}{space 4}-3.065289{col 71}{space 3} .6476662
{txt}{space 4}d1l1llngdppc {c |}{col 18}{res}{space 2}-.6227696{col 30}{space 2} 1.266047{col 41}{space 1}   -0.49{col 50}{space 3}0.623{col 58}{space 4}-3.104177{col 71}{space 3} 1.858638
{txt}{space 3}d1l1lngdp_smp {c |}{col 18}{res}{space 2} 1.394687{col 30}{space 2} 1.930338{col 41}{space 1}    0.72{col 50}{space 3}0.470{col 58}{space 4}-2.388706{col 71}{space 3} 5.178079
{txt}{space 4}d1l1rernlgdp {c |}{col 18}{res}{space 2} .5584878{col 30}{space 2}  .099803{col 41}{space 1}    5.60{col 50}{space 3}0.000{col 58}{space 4} .3628776{col 71}{space 3}  .754098
{txt}{space 4}d1l1govshare {c |}{col 18}{res}{space 2} .0478696{col 30}{space 2} .0339573{col 41}{space 1}    1.41{col 50}{space 3}0.159{col 58}{space 4}-.0186855{col 71}{space 3} .1144247
{txt}d1l1l1lnresenval {c |}{col 18}{res}{space 2} .0882772{col 30}{space 2} .0953358{col 41}{space 1}    0.93{col 50}{space 3}0.354{col 58}{space 4}-.0985775{col 71}{space 3} .2751318
{txt}{space 9}d1l1yw1 {c |}{col 18}{res}{space 2}  .028617{col 30}{space 2} .1920664{col 41}{space 1}    0.15{col 50}{space 3}0.882{col 58}{space 4}-.3478263{col 71}{space 3} .4050602
{txt}{space 11}_cons {c |}{col 18}{res}{space 2} 15.84012{col 30}{space 2} 2.654605{col 41}{space 1}    5.97{col 50}{space 3}0.000{col 58}{space 4} 10.63719{col 71}{space 3} 21.04305
{txt}{hline 17}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .3966871   .0693407     5.72   0.000{col 58} .2607818    .5325923
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50} 32.728{txt} ({res}0.000{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50} 34.684{txt} ({res}0.000{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60} 29.778{txt} ({res}0.000{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  2.501{txt} ({res}0.114{txt})

Acceptable range for rho: {res}-3.275 < rho < 1.000


{txt}
{com}.                                 
.         restore
{txt}
{com}. 
. 
. // Table 5
. 
.         preserve
{txt}
{com}. 
.                 qui reg $lhs $rhs1 l1lnresenval
{txt}
{com}.                 keep if e(sample)
{txt}(3254 observations deleted)

{com}. 
.                 qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.                 subsave dij* using "$path\w.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w.dta saved

{com}.                 spatwmat using "$path\w.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}1162x1162


{txt}
{com}.                 matrix eigenvalues re im = w
{txt}
{com}.                 matrix e = re'
{txt}
{com}.                 mkmat $lhs, mat(y)
{res}{txt}
{com}.                 matrix yw=w*y
{txt}
{com}.                 svmat yw
{txt}
{com}.                 sort idcode year
{txt}
{com}.                 foreach var of varlist ln_poptot lnhumanav  ln_dist trend llngdppc lngdp_smp  rernlgdp govshare  l1lnresenval yw1 {c -(} 
{txt}  2{com}.                 gen d1`var'=d1.`var'
{txt}  3{com}.                 gen l1`var'=l1.`var'
{txt}  4{com}.                 {c )-} 
{txt}(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)
(84 missing values generated)

{com}.                 gen d1$lhs=d1.$lhs
{txt}(84 missing values generated)

{com}.                 gen l1$lhs=l1.$lhs
{txt}(84 missing values generated)

{com}.                 gen d1l1$lhs=d1l1.$lhs
{txt}(164 missing values generated)

{com}. 
.                 qui reg d1lnfdinores d1ln_poptot   d1lnhumanav   d1llngdppc d1lngdp_smp  d1rernlgdp d1govshare d1l1lnresenval  l1lnfdinores l1ln_poptot   l1lnhumanav   l1ln_dist  l1trend l1llngdppc l1lngdp_smp  l1rernlgdp l1govshare l1l1lnresenval l1yw1 d1l1lnfdinores
{txt}
{com}.                 keep if e(sample)
{txt}(164 observations deleted)

{com}. 
.                 sort idcode year
{txt}
{com}.                 qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.                 subsave dij* using "$path\w.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w.dta saved

{com}.                 spatwmat using "$path\w.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}998x998


{txt}
{com}.                 matrix eigenvalues re im = w
{txt}
{com}.                 matrix e = re'
{txt}
{com}. 
.                 capture drop cid* fid*
{txt}
{com}.                         xi, pre(f) i.idcode
{txt}i.idcode{col 19}fidcode_1-209{col 39}(naturally coded; fidcode_1 omitted)

{com}.                         xi, pre(c) i.idcode
{txt}i.idcode{col 19}cidcode_1-209{col 39}(naturally coded; cidcode_1 omitted)

{com}.                         qui foreach var of varlist cid* {c -(}
{txt}
{com}. 
.         // Table 5a
.                 spatreg2 d1lnfdinores d1ln_poptot   d1lnhumanav   d1llngdppc d1lngdp_smp  d1rernlgdp d1govshare d1l1lnresenval  l1lnfdinores l1ln_poptot   l1lnhumanav   l1ln_dist  l1trend l1llngdppc l1lngdp_smp  l1rernlgdp l1govshare l1l1lnresenval l1yw1 d1l1lnfdinores, robust w(w) e(e) model(lag)
{res}
{txt}initial:       log pseudolikelihood = {res}-800.18201
{txt}rescale:       log pseudolikelihood = {res}-800.18201
{txt}rescale eq:    log pseudolikelihood = {res}-800.18201
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-800.18201{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-796.47081{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-796.43259{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-796.43259{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}       998
{txt}{col 52}Variance ratio{col 68}={res}     0.147
{txt}{col 52}Squared corr.{col 68}={res}     0.152
{txt}Log likelihood = {res}-796.43259{txt}{col 52}Sigma{col 68}={res}      0.54

{txt}{hline 15}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 16}{c |}{col 28}    Robust
{col 1}  d1lnfdinores{col 16}{c |}      Coef.{col 28}   Std. Err.{col 40}      z{col 48}   P>|z|{col 56}     [95% Con{col 69}f. Interval]
{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}d1lnfdinores   {txt}{c |}
{space 3}d1ln_poptot {c |}{col 16}{res}{space 2}  1.27133{col 28}{space 2} .7378893{col 39}{space 1}    1.72{col 48}{space 3}0.085{col 56}{space 4}-.1749064{col 69}{space 3} 2.717567
{txt}{space 3}d1lnhumanav {c |}{col 16}{res}{space 2} .1224553{col 28}{space 2} .3725675{col 39}{space 1}    0.33{col 48}{space 3}0.742{col 56}{space 4}-.6077636{col 69}{space 3} .8526742
{txt}{space 4}d1llngdppc {c |}{col 16}{res}{space 2} .4831942{col 28}{space 2} .5480094{col 39}{space 1}    0.88{col 48}{space 3}0.378{col 56}{space 4}-.5908845{col 69}{space 3} 1.557273
{txt}{space 3}d1lngdp_smp {c |}{col 16}{res}{space 2}-1.181747{col 28}{space 2} .7693724{col 39}{space 1}   -1.54{col 48}{space 3}0.125{col 56}{space 4}-2.689689{col 69}{space 3} .3261955
{txt}{space 4}d1rernlgdp {c |}{col 16}{res}{space 2} .0109051{col 28}{space 2} .0363456{col 39}{space 1}    0.30{col 48}{space 3}0.764{col 56}{space 4} -.060331{col 69}{space 3} .0821411
{txt}{space 4}d1govshare {c |}{col 16}{res}{space 2}  .008133{col 28}{space 2}   .01064{col 39}{space 1}    0.76{col 48}{space 3}0.445{col 56}{space 4}-.0127209{col 69}{space 3}  .028987
{txt}d1l1lnresenval {c |}{col 16}{res}{space 2}-.0049304{col 28}{space 2} .0516114{col 39}{space 1}   -0.10{col 48}{space 3}0.924{col 56}{space 4} -.106087{col 69}{space 3} .0962262
{txt}{space 2}l1lnfdinores {c |}{col 16}{res}{space 2}-.1449719{col 28}{space 2}  .034838{col 39}{space 1}   -4.16{col 48}{space 3}0.000{col 56}{space 4}-.2132531{col 69}{space 3}-.0766907
{txt}{space 3}l1ln_poptot {c |}{col 16}{res}{space 2} .1495624{col 28}{space 2} .0379283{col 39}{space 1}    3.94{col 48}{space 3}0.000{col 56}{space 4} .0752243{col 69}{space 3} .2239004
{txt}{space 3}l1lnhumanav {c |}{col 16}{res}{space 2} .3756192{col 28}{space 2} .0937689{col 39}{space 1}    4.01{col 48}{space 3}0.000{col 56}{space 4} .1918355{col 69}{space 3}  .559403
{txt}{space 5}l1ln_dist {c |}{col 16}{res}{space 2}-.1925067{col 28}{space 2}  .066701{col 39}{space 1}   -2.89{col 48}{space 3}0.004{col 56}{space 4}-.3232382{col 69}{space 3}-.0617752
{txt}{space 7}l1trend {c |}{col 16}{res}{space 2} .0021338{col 28}{space 2} .0065509{col 39}{space 1}    0.33{col 48}{space 3}0.745{col 56}{space 4}-.0107057{col 69}{space 3} .0149732
{txt}{space 4}l1llngdppc {c |}{col 16}{res}{space 2} .0601134{col 28}{space 2} .0463482{col 39}{space 1}    1.30{col 48}{space 3}0.195{col 56}{space 4}-.0307273{col 69}{space 3} .1509542
{txt}{space 3}l1lngdp_smp {c |}{col 16}{res}{space 2}-.2970636{col 28}{space 2} .1218578{col 39}{space 1}   -2.44{col 48}{space 3}0.015{col 56}{space 4}-.5359005{col 69}{space 3}-.0582266
{txt}{space 4}l1rernlgdp {c |}{col 16}{res}{space 2}-.0750222{col 28}{space 2} .0247039{col 39}{space 1}   -3.04{col 48}{space 3}0.002{col 56}{space 4}-.1234409{col 69}{space 3}-.0266035
{txt}{space 4}l1govshare {c |}{col 16}{res}{space 2}-.0102423{col 28}{space 2} .0034702{col 39}{space 1}   -2.95{col 48}{space 3}0.003{col 56}{space 4}-.0170439{col 69}{space 3}-.0034408
{txt}l1l1lnresenval {c |}{col 16}{res}{space 2}-.0196726{col 28}{space 2} .0087041{col 39}{space 1}   -2.26{col 48}{space 3}0.024{col 56}{space 4}-.0367323{col 69}{space 3}-.0026128
{txt}{space 9}l1yw1 {c |}{col 16}{res}{space 2} .0910816{col 28}{space 2}  .031032{col 39}{space 1}    2.94{col 48}{space 3}0.003{col 56}{space 4}   .03026{col 69}{space 3} .1519032
{txt}d1l1lnfdinores {c |}{col 16}{res}{space 2}-.0093095{col 28}{space 2} .0293476{col 39}{space 1}   -0.32{col 48}{space 3}0.751{col 56}{space 4}-.0668298{col 69}{space 3} .0482108
{txt}{space 9}_cons {c |}{col 16}{res}{space 2} 1.933732{col 28}{space 2} 1.073572{col 39}{space 1}    1.80{col 48}{space 3}0.072{col 56}{space 4} -.170431{col 69}{space 3} 4.037896
{txt}{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .2469378   .0966195     2.56   0.011{col 58}  .057567    .4363086
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  6.532{txt} ({res}0.011{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50}  9.358{txt} ({res}0.002{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60}  0.079{txt} ({res}0.779{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  0.135{txt} ({res}0.713{txt})

Acceptable range for rho: {res}-3.322 < rho < 1.000


{txt}
{com}.         // Table 5b
.                 spatreg2 d1lnfdinores d1ln_poptot   d1lnhumanav   d1llngdppc d1lngdp_smp  d1rernlgdp d1govshare d1l1lnresenval  l1lnfdinores l1ln_poptot   l1lnhumanav   l1ln_dist  l1trend l1llngdppc l1lngdp_smp  l1rernlgdp l1govshare l1l1lnresenval l1yw1 d1l1lnfdinores, robust w(w) e(e) model(lag) vce(cluster idcode)
{res}
{txt}initial:       log pseudolikelihood = {res}-800.18201
{txt}rescale:       log pseudolikelihood = {res}-800.18201
{txt}rescale eq:    log pseudolikelihood = {res}-800.18201
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-800.18201{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-796.47081{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-796.43259{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-796.43259{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}       998
{txt}{col 52}Variance ratio{col 68}={res}     0.147
{txt}{col 52}Squared corr.{col 68}={res}     0.152
{txt}Log likelihood = {res}-796.43259{txt}{col 52}Sigma{col 68}={res}      0.54

{txt}{ralign 80:(Std. Err. adjusted for {res:70} clusters in idcode)}
{hline 15}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 16}{c |}{col 28}    Robust
{col 1}  d1lnfdinores{col 16}{c |}      Coef.{col 28}   Std. Err.{col 40}      z{col 48}   P>|z|{col 56}     [95% Con{col 69}f. Interval]
{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}d1lnfdinores   {txt}{c |}
{space 3}d1ln_poptot {c |}{col 16}{res}{space 2}  1.27133{col 28}{space 2} .5395443{col 39}{space 1}    2.36{col 48}{space 3}0.018{col 56}{space 4} .2138428{col 69}{space 3} 2.328818
{txt}{space 3}d1lnhumanav {c |}{col 16}{res}{space 2} .1224553{col 28}{space 2} .3250261{col 39}{space 1}    0.38{col 48}{space 3}0.706{col 56}{space 4}-.5145842{col 69}{space 3} .7594948
{txt}{space 4}d1llngdppc {c |}{col 16}{res}{space 2} .4831942{col 28}{space 2} .4498457{col 39}{space 1}    1.07{col 48}{space 3}0.283{col 56}{space 4}-.3984872{col 69}{space 3} 1.364876
{txt}{space 3}d1lngdp_smp {c |}{col 16}{res}{space 2}-1.181747{col 28}{space 2} .8086753{col 39}{space 1}   -1.46{col 48}{space 3}0.144{col 56}{space 4}-2.766721{col 69}{space 3} .4032278
{txt}{space 4}d1rernlgdp {c |}{col 16}{res}{space 2} .0109051{col 28}{space 2} .0343953{col 39}{space 1}    0.32{col 48}{space 3}0.751{col 56}{space 4}-.0565084{col 69}{space 3} .0783185
{txt}{space 4}d1govshare {c |}{col 16}{res}{space 2}  .008133{col 28}{space 2} .0116915{col 39}{space 1}    0.70{col 48}{space 3}0.487{col 56}{space 4}-.0147819{col 69}{space 3}  .031048
{txt}d1l1lnresenval {c |}{col 16}{res}{space 2}-.0049304{col 28}{space 2} .0503029{col 39}{space 1}   -0.10{col 48}{space 3}0.922{col 56}{space 4}-.1035223{col 69}{space 3} .0936614
{txt}{space 2}l1lnfdinores {c |}{col 16}{res}{space 2}-.1449719{col 28}{space 2} .0311618{col 39}{space 1}   -4.65{col 48}{space 3}0.000{col 56}{space 4}-.2060479{col 69}{space 3}-.0838958
{txt}{space 3}l1ln_poptot {c |}{col 16}{res}{space 2} .1495624{col 28}{space 2} .0369116{col 39}{space 1}    4.05{col 48}{space 3}0.000{col 56}{space 4} .0772171{col 69}{space 3} .2219077
{txt}{space 3}l1lnhumanav {c |}{col 16}{res}{space 2} .3756192{col 28}{space 2} .0943749{col 39}{space 1}    3.98{col 48}{space 3}0.000{col 56}{space 4} .1906479{col 69}{space 3} .5605906
{txt}{space 5}l1ln_dist {c |}{col 16}{res}{space 2}-.1925067{col 28}{space 2} .0576722{col 39}{space 1}   -3.34{col 48}{space 3}0.001{col 56}{space 4}-.3055422{col 69}{space 3}-.0794713
{txt}{space 7}l1trend {c |}{col 16}{res}{space 2} .0021338{col 28}{space 2} .0071857{col 39}{space 1}    0.30{col 48}{space 3}0.767{col 56}{space 4}-.0119499{col 69}{space 3} .0162175
{txt}{space 4}l1llngdppc {c |}{col 16}{res}{space 2} .0601134{col 28}{space 2} .0526016{col 39}{space 1}    1.14{col 48}{space 3}0.253{col 56}{space 4}-.0429838{col 69}{space 3} .1632107
{txt}{space 3}l1lngdp_smp {c |}{col 16}{res}{space 2}-.2970636{col 28}{space 2}  .108513{col 39}{space 1}   -2.74{col 48}{space 3}0.006{col 56}{space 4}-.5097452{col 69}{space 3} -.084382
{txt}{space 4}l1rernlgdp {c |}{col 16}{res}{space 2}-.0750222{col 28}{space 2} .0275924{col 39}{space 1}   -2.72{col 48}{space 3}0.007{col 56}{space 4}-.1291023{col 69}{space 3}-.0209421
{txt}{space 4}l1govshare {c |}{col 16}{res}{space 2}-.0102423{col 28}{space 2} .0035818{col 39}{space 1}   -2.86{col 48}{space 3}0.004{col 56}{space 4}-.0172626{col 69}{space 3} -.003222
{txt}l1l1lnresenval {c |}{col 16}{res}{space 2}-.0196726{col 28}{space 2} .0090205{col 39}{space 1}   -2.18{col 48}{space 3}0.029{col 56}{space 4}-.0373524{col 69}{space 3}-.0019927
{txt}{space 9}l1yw1 {c |}{col 16}{res}{space 2} .0910816{col 28}{space 2} .0372244{col 39}{space 1}    2.45{col 48}{space 3}0.014{col 56}{space 4}  .018123{col 69}{space 3} .1640402
{txt}d1l1lnfdinores {c |}{col 16}{res}{space 2}-.0093095{col 28}{space 2} .0286535{col 39}{space 1}   -0.32{col 48}{space 3}0.745{col 56}{space 4}-.0654693{col 69}{space 3} .0468503
{txt}{space 9}_cons {c |}{col 16}{res}{space 2} 1.933732{col 28}{space 2} .9655702{col 39}{space 1}    2.00{col 48}{space 3}0.045{col 56}{space 4} .0412496{col 69}{space 3} 3.826215
{txt}{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .2469378   .2444735     1.01   0.312{col 58}-.2322214    .7260969
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  1.020{txt} ({res}0.312{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50}  9.358{txt} ({res}0.002{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60}  0.079{txt} ({res}0.779{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  0.135{txt} ({res}0.713{txt})

Acceptable range for rho: {res}-3.322 < rho < 1.000


{txt}
{com}.                 drop  fidcode_72 fidcode_44
{txt}
{com}.         // Table 5c
.                 spatreg2 d1lnfdinores d1ln_poptot   d1lnhumanav   d1llngdppc d1lngdp_smp  d1rernlgdp d1govshare d1l1lnresenval  l1lnfdinores l1ln_poptot   l1lnhumanav     l1trend l1llngdppc l1lngdp_smp  l1rernlgdp l1govshare l1l1lnresenval l1yw1 d1l1lnfdinores fid* cid*, robust w(w) e(e) model(lag)
{res}
{txt}initial:       log pseudolikelihood = {res} -583.8086
{txt}rescale:       log pseudolikelihood = {res} -583.8086
{txt}rescale eq:    log pseudolikelihood = {res} -583.8086
{txt}Iteration 0:{col 16}log pseudolikelihood = {res} -583.8086{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-574.81922{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-573.93055{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-573.92823{txt}  
Iteration 4:{col 16}log pseudolikelihood = {res}-573.92823{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}       998
{txt}{col 52}Variance ratio{col 68}={res}     0.455
{txt}{col 52}Squared corr.{col 68}={res}     0.457
{txt}Log likelihood = {res}-573.92823{txt}{col 52}Sigma{col 68}={res}      0.43

{txt}{hline 15}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 16}{c |}{col 28}    Robust
{col 1}  d1lnfdinores{col 16}{c |}      Coef.{col 28}   Std. Err.{col 40}      z{col 48}   P>|z|{col 56}     [95% Con{col 69}f. Interval]
{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}d1lnfdinores   {txt}{c |}
{space 3}d1ln_poptot {c |}{col 16}{res}{space 2}  1.31736{col 28}{space 2} .5250234{col 39}{space 1}    2.51{col 48}{space 3}0.012{col 56}{space 4} .2883327{col 69}{space 3} 2.346387
{txt}{space 3}d1lnhumanav {c |}{col 16}{res}{space 2} .1633304{col 28}{space 2} .3829946{col 39}{space 1}    0.43{col 48}{space 3}0.670{col 56}{space 4}-.5873252{col 69}{space 3} .9139859
{txt}{space 4}d1llngdppc {c |}{col 16}{res}{space 2}   .64485{col 28}{space 2} .5356263{col 39}{space 1}    1.20{col 48}{space 3}0.229{col 56}{space 4}-.4049582{col 69}{space 3} 1.694658
{txt}{space 3}d1lngdp_smp {c |}{col 16}{res}{space 2}-1.262772{col 28}{space 2} .7539995{col 39}{space 1}   -1.67{col 48}{space 3}0.094{col 56}{space 4}-2.740584{col 69}{space 3} .2150398
{txt}{space 4}d1rernlgdp {c |}{col 16}{res}{space 2} .1508339{col 28}{space 2} .0669538{col 39}{space 1}    2.25{col 48}{space 3}0.024{col 56}{space 4} .0196068{col 69}{space 3}  .282061
{txt}{space 4}d1govshare {c |}{col 16}{res}{space 2}-.0059463{col 28}{space 2} .0165185{col 39}{space 1}   -0.36{col 48}{space 3}0.719{col 56}{space 4}-.0383219{col 69}{space 3} .0264293
{txt}d1l1lnresenval {c |}{col 16}{res}{space 2} -.051354{col 28}{space 2} .0315202{col 39}{space 1}   -1.63{col 48}{space 3}0.103{col 56}{space 4}-.1131325{col 69}{space 3} .0104245
{txt}{space 2}l1lnfdinores {c |}{col 16}{res}{space 2}-.5273238{col 28}{space 2} .0795768{col 39}{space 1}   -6.63{col 48}{space 3}0.000{col 56}{space 4}-.6832915{col 69}{space 3}-.3713561
{txt}{space 3}l1ln_poptot {c |}{col 16}{res}{space 2} 1.985465{col 28}{space 2} .9724713{col 39}{space 1}    2.04{col 48}{space 3}0.041{col 56}{space 4} .0794564{col 69}{space 3} 3.891474
{txt}{space 3}l1lnhumanav {c |}{col 16}{res}{space 2} .7709124{col 28}{space 2} .3524067{col 39}{space 1}    2.19{col 48}{space 3}0.029{col 56}{space 4} .0802079{col 69}{space 3} 1.461617
{txt}{space 7}l1trend {c |}{col 16}{res}{space 2} 2.116909{col 28}{space 2} .3657485{col 39}{space 1}    5.79{col 48}{space 3}0.000{col 56}{space 4} 1.400055{col 69}{space 3} 2.833763
{txt}{space 4}l1llngdppc {c |}{col 16}{res}{space 2}  .604101{col 28}{space 2} .3723394{col 39}{space 1}    1.62{col 48}{space 3}0.105{col 56}{space 4}-.1256709{col 69}{space 3} 1.333873
{txt}{space 3}l1lngdp_smp {c |}{col 16}{res}{space 2}-.0280994{col 28}{space 2} .4833463{col 39}{space 1}   -0.06{col 48}{space 3}0.954{col 56}{space 4}-.9754407{col 69}{space 3} .9192419
{txt}{space 4}l1rernlgdp {c |}{col 16}{res}{space 2} .2692937{col 28}{space 2} .1014253{col 39}{space 1}    2.66{col 48}{space 3}0.008{col 56}{space 4} .0705038{col 69}{space 3} .4680836
{txt}{space 4}l1govshare {c |}{col 16}{res}{space 2}-.0215177{col 28}{space 2} .0108226{col 39}{space 1}   -1.99{col 48}{space 3}0.047{col 56}{space 4}-.0427297{col 69}{space 3}-.0003057
{txt}l1l1lnresenval {c |}{col 16}{res}{space 2}-.0823761{col 28}{space 2} .0416605{col 39}{space 1}   -1.98{col 48}{space 3}0.048{col 56}{space 4}-.1640293{col 69}{space 3} -.000723
{txt}{space 9}l1yw1 {c |}{col 16}{res}{space 2} .0585945{col 28}{space 2} .0732064{col 39}{space 1}    0.80{col 48}{space 3}0.423{col 56}{space 4}-.0848873{col 69}{space 3} .2020763
{txt}d1l1lnfdinores {c |}{col 16}{res}{space 2}-.0165604{col 28}{space 2} .0450323{col 39}{space 1}   -0.37{col 48}{space 3}0.713{col 56}{space 4} -.104822{col 69}{space 3} .0717012
{txt}{space 5}fidcode_3 {c |}{col 16}{res}{space 2}  13.0861{col 28}{space 2} 2.524594{col 39}{space 1}    5.18{col 48}{space 3}0.000{col 56}{space 4} 8.137987{col 69}{space 3} 18.03421
{txt}{space 5}fidcode_8 {c |}{col 16}{res}{space 2} 13.71921{col 28}{space 2}  2.34947{col 39}{space 1}    5.84{col 48}{space 3}0.000{col 56}{space 4} 9.114338{col 69}{space 3} 18.32409
{txt}{space 4}fidcode_11 {c |}{col 16}{res}{space 2} 14.63485{col 28}{space 2} 2.651284{col 39}{space 1}    5.52{col 48}{space 3}0.000{col 56}{space 4} 9.438425{col 69}{space 3} 19.83127
{txt}{space 4}fidcode_12 {c |}{col 16}{res}{space 2} 16.29446{col 28}{space 2} 3.072295{col 39}{space 1}    5.30{col 48}{space 3}0.000{col 56}{space 4} 10.27287{col 69}{space 3} 22.31605
{txt}{space 4}fidcode_15 {c |}{col 16}{res}{space 2}  20.9104{col 28}{space 2} 5.308404{col 39}{space 1}    3.94{col 48}{space 3}0.000{col 56}{space 4} 10.50612{col 69}{space 3} 31.31468
{txt}{space 4}fidcode_16 {c |}{col 16}{res}{space 2} 11.65576{col 28}{space 2} 2.438438{col 39}{space 1}    4.78{col 48}{space 3}0.000{col 56}{space 4} 6.876514{col 69}{space 3} 16.43501
{txt}{space 4}fidcode_17 {c |}{col 16}{res}{space 2} 14.86403{col 28}{space 2} 6.130792{col 39}{space 1}    2.42{col 48}{space 3}0.015{col 56}{space 4} 2.847901{col 69}{space 3} 26.88016
{txt}{space 4}fidcode_19 {c |}{col 16}{res}{space 2} 17.00944{col 28}{space 2}  2.89571{col 39}{space 1}    5.87{col 48}{space 3}0.000{col 56}{space 4} 11.33396{col 69}{space 3} 22.68493
{txt}{space 4}fidcode_21 {c |}{col 16}{res}{space 2} 10.50806{col 28}{space 2} 3.797783{col 39}{space 1}    2.77{col 48}{space 3}0.006{col 56}{space 4} 3.064542{col 69}{space 3} 17.95158
{txt}{space 4}fidcode_24 {c |}{col 16}{res}{space 2} 14.19282{col 28}{space 2}  3.13702{col 39}{space 1}    4.52{col 48}{space 3}0.000{col 56}{space 4} 8.044373{col 69}{space 3} 20.34127
{txt}{space 4}fidcode_26 {c |}{col 16}{res}{space 2} 22.79798{col 28}{space 2} 4.327503{col 39}{space 1}    5.27{col 48}{space 3}0.000{col 56}{space 4} 14.31623{col 69}{space 3} 31.27973
{txt}{space 4}fidcode_27 {c |}{col 16}{res}{space 2} 12.68766{col 28}{space 2} 2.431108{col 39}{space 1}    5.22{col 48}{space 3}0.000{col 56}{space 4} 7.922776{col 69}{space 3} 17.45254
{txt}{space 4}fidcode_33 {c |}{col 16}{res}{space 2} 15.95344{col 28}{space 2} 2.767811{col 39}{space 1}    5.76{col 48}{space 3}0.000{col 56}{space 4} 10.52863{col 69}{space 3} 21.37825
{txt}{space 4}fidcode_34 {c |}{col 16}{res}{space 2}  13.9836{col 28}{space 2}  2.45196{col 39}{space 1}    5.70{col 48}{space 3}0.000{col 56}{space 4} 9.177846{col 69}{space 3} 18.78935
{txt}{space 4}fidcode_40 {c |}{col 16}{res}{space 2} 15.42067{col 28}{space 2} 2.581938{col 39}{space 1}    5.97{col 48}{space 3}0.000{col 56}{space 4} 10.36017{col 69}{space 3} 20.48118
{txt}{space 4}fidcode_41 {c |}{col 16}{res}{space 2} 7.834872{col 28}{space 2} 4.040091{col 39}{space 1}    1.94{col 48}{space 3}0.052{col 56}{space 4}-.0835611{col 69}{space 3}  15.7533
{txt}{space 4}fidcode_42 {c |}{col 16}{res}{space 2} 14.24292{col 28}{space 2} 2.268299{col 39}{space 1}    6.28{col 48}{space 3}0.000{col 56}{space 4} 9.797138{col 69}{space 3} 18.68871
{txt}{space 4}fidcode_45 {c |}{col 16}{res}{space 2} 19.26552{col 28}{space 2} 3.816678{col 39}{space 1}    5.05{col 48}{space 3}0.000{col 56}{space 4} 11.78497{col 69}{space 3} 26.74607
{txt}{space 4}fidcode_52 {c |}{col 16}{res}{space 2} 15.69989{col 28}{space 2} 3.295606{col 39}{space 1}    4.76{col 48}{space 3}0.000{col 56}{space 4} 9.240625{col 69}{space 3} 22.15916
{txt}{space 4}fidcode_56 {c |}{col 16}{res}{space 2}  15.7647{col 28}{space 2} 2.799706{col 39}{space 1}    5.63{col 48}{space 3}0.000{col 56}{space 4} 10.27738{col 69}{space 3} 21.25202
{txt}{space 4}fidcode_57 {c |}{col 16}{res}{space 2} 14.86601{col 28}{space 2} 2.209036{col 39}{space 1}    6.73{col 48}{space 3}0.000{col 56}{space 4} 10.53638{col 69}{space 3} 19.19564
{txt}{space 4}fidcode_66 {c |}{col 16}{res}{space 2} 13.53659{col 28}{space 2} 2.283738{col 39}{space 1}    5.93{col 48}{space 3}0.000{col 56}{space 4} 9.060547{col 69}{space 3} 18.01264
{txt}{space 4}fidcode_71 {c |}{col 16}{res}{space 2} 13.06648{col 28}{space 2} 2.312361{col 39}{space 1}    5.65{col 48}{space 3}0.000{col 56}{space 4} 8.534339{col 69}{space 3} 17.59863
{txt}{space 4}fidcode_73 {c |}{col 16}{res}{space 2} 15.94404{col 28}{space 2} 2.782066{col 39}{space 1}    5.73{col 48}{space 3}0.000{col 56}{space 4} 10.49129{col 69}{space 3} 21.39679
{txt}{space 4}fidcode_77 {c |}{col 16}{res}{space 2} 13.45295{col 28}{space 2} 2.870176{col 39}{space 1}    4.69{col 48}{space 3}0.000{col 56}{space 4} 7.827512{col 69}{space 3} 19.07839
{txt}{space 4}fidcode_84 {c |}{col 16}{res}{space 2} 14.28851{col 28}{space 2} 2.996448{col 39}{space 1}    4.77{col 48}{space 3}0.000{col 56}{space 4} 8.415575{col 69}{space 3} 20.16144
{txt}{space 4}fidcode_86 {c |}{col 16}{res}{space 2} 8.614154{col 28}{space 2} 3.626349{col 39}{space 1}    2.38{col 48}{space 3}0.018{col 56}{space 4}  1.50664{col 69}{space 3} 15.72167
{txt}{space 4}fidcode_87 {c |}{col 16}{res}{space 2} 12.25575{col 28}{space 2} 2.602736{col 39}{space 1}    4.71{col 48}{space 3}0.000{col 56}{space 4} 7.154485{col 69}{space 3} 17.35702
{txt}{space 4}fidcode_89 {c |}{col 16}{res}{space 2} 7.938312{col 28}{space 2} 3.208635{col 39}{space 1}    2.47{col 48}{space 3}0.013{col 56}{space 4} 1.649503{col 69}{space 3} 14.22712
{txt}{space 4}fidcode_90 {c |}{col 16}{res}{space 2} 17.12077{col 28}{space 2}   3.4154{col 39}{space 1}    5.01{col 48}{space 3}0.000{col 56}{space 4} 10.42671{col 69}{space 3} 23.81483
{txt}{space 4}fidcode_92 {c |}{col 16}{res}{space 2} 15.14371{col 28}{space 2} 3.401767{col 39}{space 1}    4.45{col 48}{space 3}0.000{col 56}{space 4} 8.476374{col 69}{space 3} 21.81106
{txt}{space 4}fidcode_93 {c |}{col 16}{res}{space 2} 12.70912{col 28}{space 2} 2.303055{col 39}{space 1}    5.52{col 48}{space 3}0.000{col 56}{space 4} 8.195211{col 69}{space 3} 17.22302
{txt}{space 4}fidcode_95 {c |}{col 16}{res}{space 2} 11.14408{col 28}{space 2} 2.421416{col 39}{space 1}    4.60{col 48}{space 3}0.000{col 56}{space 4} 6.398191{col 69}{space 3} 15.88997
{txt}{space 4}fidcode_96 {c |}{col 16}{res}{space 2} 15.56681{col 28}{space 2} 3.693127{col 39}{space 1}    4.22{col 48}{space 3}0.000{col 56}{space 4} 8.328409{col 69}{space 3}  22.8052
{txt}{space 3}fidcode_101 {c |}{col 16}{res}{space 2}  11.7705{col 28}{space 2}  2.39396{col 39}{space 1}    4.92{col 48}{space 3}0.000{col 56}{space 4} 7.078423{col 69}{space 3} 16.46257
{txt}{space 3}fidcode_102 {c |}{col 16}{res}{space 2} 16.71498{col 28}{space 2} 3.891687{col 39}{space 1}    4.30{col 48}{space 3}0.000{col 56}{space 4} 9.087412{col 69}{space 3} 24.34255
{txt}{space 3}fidcode_117 {c |}{col 16}{res}{space 2} 14.70363{col 28}{space 2} 2.529464{col 39}{space 1}    5.81{col 48}{space 3}0.000{col 56}{space 4} 9.745976{col 69}{space 3} 19.66129
{txt}{space 3}fidcode_125 {c |}{col 16}{res}{space 2} 12.68314{col 28}{space 2}  2.29422{col 39}{space 1}    5.53{col 48}{space 3}0.000{col 56}{space 4} 8.186547{col 69}{space 3} 17.17972
{txt}{space 3}fidcode_131 {c |}{col 16}{res}{space 2} 12.24565{col 28}{space 2} 3.314146{col 39}{space 1}    3.69{col 48}{space 3}0.000{col 56}{space 4} 5.750043{col 69}{space 3} 18.74125
{txt}{space 3}fidcode_134 {c |}{col 16}{res}{space 2} 8.119392{col 28}{space 2} 3.290556{col 39}{space 1}    2.47{col 48}{space 3}0.014{col 56}{space 4}  1.67002{col 69}{space 3} 14.56876
{txt}{space 3}fidcode_138 {c |}{col 16}{res}{space 2} 16.30484{col 28}{space 2} 3.593757{col 39}{space 1}    4.54{col 48}{space 3}0.000{col 56}{space 4} 9.261203{col 69}{space 3} 23.34847
{txt}{space 3}fidcode_140 {c |}{col 16}{res}{space 2} 12.99462{col 28}{space 2} 4.278543{col 39}{space 1}    3.04{col 48}{space 3}0.002{col 56}{space 4} 4.608833{col 69}{space 3} 21.38041
{txt}{space 3}fidcode_143 {c |}{col 16}{res}{space 2} 16.23663{col 28}{space 2} 3.435848{col 39}{space 1}    4.73{col 48}{space 3}0.000{col 56}{space 4} 9.502494{col 69}{space 3} 22.97077
{txt}{space 3}fidcode_145 {c |}{col 16}{res}{space 2} 12.47367{col 28}{space 2} 2.431327{col 39}{space 1}    5.13{col 48}{space 3}0.000{col 56}{space 4} 7.708359{col 69}{space 3} 17.23899
{txt}{space 3}fidcode_148 {c |}{col 16}{res}{space 2} 19.56078{col 28}{space 2} 3.329272{col 39}{space 1}    5.88{col 48}{space 3}0.000{col 56}{space 4} 13.03553{col 69}{space 3} 26.08603
{txt}{space 3}fidcode_150 {c |}{col 16}{res}{space 2} 12.93364{col 28}{space 2} 2.531907{col 39}{space 1}    5.11{col 48}{space 3}0.000{col 56}{space 4} 7.971196{col 69}{space 3} 17.89609
{txt}{space 3}fidcode_151 {c |}{col 16}{res}{space 2} 12.22539{col 28}{space 2} 2.274483{col 39}{space 1}    5.38{col 48}{space 3}0.000{col 56}{space 4} 7.767489{col 69}{space 3}  16.6833
{txt}{space 3}fidcode_152 {c |}{col 16}{res}{space 2}  14.2974{col 28}{space 2} 2.776796{col 39}{space 1}    5.15{col 48}{space 3}0.000{col 56}{space 4} 8.854983{col 69}{space 3} 19.73982
{txt}{space 3}fidcode_153 {c |}{col 16}{res}{space 2} 16.00629{col 28}{space 2} 2.676636{col 39}{space 1}    5.98{col 48}{space 3}0.000{col 56}{space 4} 10.76018{col 69}{space 3}  21.2524
{txt}{space 3}fidcode_158 {c |}{col 16}{res}{space 2}  18.6048{col 28}{space 2} 2.833004{col 39}{space 1}    6.57{col 48}{space 3}0.000{col 56}{space 4} 13.05222{col 69}{space 3} 24.15739
{txt}{space 3}fidcode_163 {c |}{col 16}{res}{space 2} 17.72492{col 28}{space 2}  2.88775{col 39}{space 1}    6.14{col 48}{space 3}0.000{col 56}{space 4} 12.06504{col 69}{space 3} 23.38481
{txt}{space 3}fidcode_172 {c |}{col 16}{res}{space 2} 14.29673{col 28}{space 2} 2.345936{col 39}{space 1}    6.09{col 48}{space 3}0.000{col 56}{space 4} 9.698783{col 69}{space 3} 18.89468
{txt}{space 3}fidcode_173 {c |}{col 16}{res}{space 2} 14.36351{col 28}{space 2} 2.238669{col 39}{space 1}    6.42{col 48}{space 3}0.000{col 56}{space 4}   9.9758{col 69}{space 3} 18.75122
{txt}{space 3}fidcode_178 {c |}{col 16}{res}{space 2} 4.298398{col 28}{space 2} 4.113423{col 39}{space 1}    1.04{col 48}{space 3}0.296{col 56}{space 4}-3.763763{col 69}{space 3} 12.36056
{txt}{space 3}fidcode_180 {c |}{col 16}{res}{space 2} 21.34174{col 28}{space 2} 4.641065{col 39}{space 1}    4.60{col 48}{space 3}0.000{col 56}{space 4} 12.24542{col 69}{space 3} 30.43806
{txt}{space 3}fidcode_181 {c |}{col 16}{res}{space 2} 14.64582{col 28}{space 2} 2.897481{col 39}{space 1}    5.05{col 48}{space 3}0.000{col 56}{space 4} 8.966864{col 69}{space 3} 20.32478
{txt}{space 3}fidcode_182 {c |}{col 16}{res}{space 2} 16.26815{col 28}{space 2} 3.194294{col 39}{space 1}    5.09{col 48}{space 3}0.000{col 56}{space 4} 10.00745{col 69}{space 3} 22.52885
{txt}{space 3}fidcode_183 {c |}{col 16}{res}{space 2} 16.77578{col 28}{space 2} 2.927798{col 39}{space 1}    5.73{col 48}{space 3}0.000{col 56}{space 4}  11.0374{col 69}{space 3} 22.51416
{txt}{space 3}fidcode_187 {c |}{col 16}{res}{space 2} 13.38034{col 28}{space 2} 2.226049{col 39}{space 1}    6.01{col 48}{space 3}0.000{col 56}{space 4} 9.017359{col 69}{space 3} 17.74331
{txt}{space 3}fidcode_191 {c |}{col 16}{res}{space 2} 18.28094{col 28}{space 2} 4.182209{col 39}{space 1}    4.37{col 48}{space 3}0.000{col 56}{space 4} 10.08396{col 69}{space 3} 26.47791
{txt}{space 3}fidcode_192 {c |}{col 16}{res}{space 2}  16.7559{col 28}{space 2} 2.930822{col 39}{space 1}    5.72{col 48}{space 3}0.000{col 56}{space 4}  11.0116{col 69}{space 3} 22.50021
{txt}{space 3}fidcode_193 {c |}{col 16}{res}{space 2}  12.9009{col 28}{space 2} 2.250937{col 39}{space 1}    5.73{col 48}{space 3}0.000{col 56}{space 4} 8.489148{col 69}{space 3} 17.31266
{txt}{space 3}fidcode_198 {c |}{col 16}{res}{space 2} 13.68595{col 28}{space 2} 2.309389{col 39}{space 1}    5.93{col 48}{space 3}0.000{col 56}{space 4} 9.159634{col 69}{space 3} 18.21227
{txt}{space 3}fidcode_199 {c |}{col 16}{res}{space 2} 10.95546{col 28}{space 2} 2.731127{col 39}{space 1}    4.01{col 48}{space 3}0.000{col 56}{space 4} 5.602549{col 69}{space 3} 16.30837
{txt}{space 3}fidcode_203 {c |}{col 16}{res}{space 2}   15.552{col 28}{space 2} 2.619801{col 39}{space 1}    5.94{col 48}{space 3}0.000{col 56}{space 4} 10.41729{col 69}{space 3} 20.68672
{txt}{space 3}fidcode_208 {c |}{col 16}{res}{space 2} 17.32342{col 28}{space 2} 2.885918{col 39}{space 1}    6.00{col 48}{space 3}0.000{col 56}{space 4} 11.66712{col 69}{space 3} 22.97971
{txt}{space 3}fidcode_209 {c |}{col 16}{res}{space 2} 17.03539{col 28}{space 2} 2.764621{col 39}{space 1}    6.16{col 48}{space 3}0.000{col 56}{space 4} 11.61683{col 69}{space 3} 22.45395
{txt}{space 5}cidcode_3 {c |}{col 16}{res}{space 2}-2.092674{col 28}{space 2} .3780771{col 39}{space 1}   -5.54{col 48}{space 3}0.000{col 56}{space 4}-2.833692{col 69}{space 3}-1.351657
{txt}{space 5}cidcode_8 {c |}{col 16}{res}{space 2}-2.112554{col 28}{space 2} .3718609{col 39}{space 1}   -5.68{col 48}{space 3}0.000{col 56}{space 4}-2.841388{col 69}{space 3} -1.38372
{txt}{space 4}cidcode_11 {c |}{col 16}{res}{space 2}-2.088741{col 28}{space 2} .3713732{col 39}{space 1}   -5.62{col 48}{space 3}0.000{col 56}{space 4}-2.816619{col 69}{space 3}-1.360863
{txt}{space 4}cidcode_12 {c |}{col 16}{res}{space 2}-2.125203{col 28}{space 2} .3695581{col 39}{space 1}   -5.75{col 48}{space 3}0.000{col 56}{space 4}-2.849524{col 69}{space 3}-1.400883
{txt}{space 4}cidcode_15 {c |}{col 16}{res}{space 2}-2.189983{col 28}{space 2} .3799623{col 39}{space 1}   -5.76{col 48}{space 3}0.000{col 56}{space 4}-2.934695{col 69}{space 3} -1.44527
{txt}{space 4}cidcode_16 {c |}{col 16}{res}{space 2}-2.130943{col 28}{space 2} .3721293{col 39}{space 1}   -5.73{col 48}{space 3}0.000{col 56}{space 4}-2.860303{col 69}{space 3}-1.401583
{txt}{space 4}cidcode_17 {c |}{col 16}{res}{space 2}-1.581847{col 28}{space 2}  .482449{col 39}{space 1}   -3.28{col 48}{space 3}0.001{col 56}{space 4} -2.52743{col 69}{space 3}-.6362642
{txt}{space 4}cidcode_19 {c |}{col 16}{res}{space 2}-2.111892{col 28}{space 2} .3715999{col 39}{space 1}   -5.68{col 48}{space 3}0.000{col 56}{space 4}-2.840214{col 69}{space 3}-1.383569
{txt}{space 4}cidcode_21 {c |}{col 16}{res}{space 2}-1.895092{col 28}{space 2} .3932905{col 39}{space 1}   -4.82{col 48}{space 3}0.000{col 56}{space 4}-2.665927{col 69}{space 3}-1.124257
{txt}{space 4}cidcode_24 {c |}{col 16}{res}{space 2}-2.011135{col 28}{space 2} .3827862{col 39}{space 1}   -5.25{col 48}{space 3}0.000{col 56}{space 4}-2.761383{col 69}{space 3}-1.260888
{txt}{space 4}cidcode_26 {c |}{col 16}{res}{space 2}-2.415993{col 28}{space 2}  .380581{col 39}{space 1}   -6.35{col 48}{space 3}0.000{col 56}{space 4}-3.161918{col 69}{space 3}-1.670068
{txt}{space 4}cidcode_27 {c |}{col 16}{res}{space 2}-2.116229{col 28}{space 2} .3741527{col 39}{space 1}   -5.66{col 48}{space 3}0.000{col 56}{space 4}-2.849555{col 69}{space 3}-1.382903
{txt}{space 4}cidcode_33 {c |}{col 16}{res}{space 2}-2.161505{col 28}{space 2} .3748477{col 39}{space 1}   -5.77{col 48}{space 3}0.000{col 56}{space 4}-2.896193{col 69}{space 3}-1.426817
{txt}{space 4}cidcode_34 {c |}{col 16}{res}{space 2}-2.099874{col 28}{space 2} .3702399{col 39}{space 1}   -5.67{col 48}{space 3}0.000{col 56}{space 4} -2.82553{col 69}{space 3}-1.374217
{txt}{space 4}cidcode_40 {c |}{col 16}{res}{space 2}-2.121868{col 28}{space 2} .3739523{col 39}{space 1}   -5.67{col 48}{space 3}0.000{col 56}{space 4}-2.854801{col 69}{space 3}-1.388935
{txt}{space 4}cidcode_41 {c |}{col 16}{res}{space 2}-2.076916{col 28}{space 2} .3733873{col 39}{space 1}   -5.56{col 48}{space 3}0.000{col 56}{space 4}-2.808742{col 69}{space 3} -1.34509
{txt}{space 4}cidcode_42 {c |}{col 16}{res}{space 2}-2.131686{col 28}{space 2} .3708022{col 39}{space 1}   -5.75{col 48}{space 3}0.000{col 56}{space 4}-2.858445{col 69}{space 3}-1.404927
{txt}{space 4}cidcode_44 {c |}{col 16}{res}{space 2}-1.499511{col 28}{space 2} .2909691{col 39}{space 1}   -5.15{col 48}{space 3}0.000{col 56}{space 4}  -2.0698{col 69}{space 3}-.9292224
{txt}{space 4}cidcode_45 {c |}{col 16}{res}{space 2}-2.134837{col 28}{space 2} .3776533{col 39}{space 1}   -5.65{col 48}{space 3}0.000{col 56}{space 4}-2.875024{col 69}{space 3} -1.39465
{txt}{space 4}cidcode_52 {c |}{col 16}{res}{space 2}-2.029786{col 28}{space 2} .3687194{col 39}{space 1}   -5.50{col 48}{space 3}0.000{col 56}{space 4}-2.752463{col 69}{space 3}-1.307109
{txt}{space 4}cidcode_56 {c |}{col 16}{res}{space 2}-2.124286{col 28}{space 2} .3755093{col 39}{space 1}   -5.66{col 48}{space 3}0.000{col 56}{space 4} -2.86027{col 69}{space 3}-1.388301
{txt}{space 4}cidcode_57 {c |}{col 16}{res}{space 2}-2.217338{col 28}{space 2} .3741898{col 39}{space 1}   -5.93{col 48}{space 3}0.000{col 56}{space 4}-2.950737{col 69}{space 3} -1.48394
{txt}{space 4}cidcode_66 {c |}{col 16}{res}{space 2}-2.095947{col 28}{space 2} .3693557{col 39}{space 1}   -5.67{col 48}{space 3}0.000{col 56}{space 4}-2.819871{col 69}{space 3}-1.372023
{txt}{space 4}cidcode_71 {c |}{col 16}{res}{space 2} -2.12081{col 28}{space 2} .3685439{col 39}{space 1}   -5.75{col 48}{space 3}0.000{col 56}{space 4}-2.843142{col 69}{space 3}-1.398477
{txt}{space 4}cidcode_72 {c |}{col 16}{res}{space 2}-1.457831{col 28}{space 2} .2737339{col 39}{space 1}   -5.33{col 48}{space 3}0.000{col 56}{space 4}-1.994339{col 69}{space 3}-.9213222
{txt}{space 4}cidcode_73 {c |}{col 16}{res}{space 2}-2.116301{col 28}{space 2} .3707164{col 39}{space 1}   -5.71{col 48}{space 3}0.000{col 56}{space 4}-2.842892{col 69}{space 3} -1.38971
{txt}{space 4}cidcode_77 {c |}{col 16}{res}{space 2}-2.025717{col 28}{space 2} .3789425{col 39}{space 1}   -5.35{col 48}{space 3}0.000{col 56}{space 4}-2.768431{col 69}{space 3}-1.283004
{txt}{space 4}cidcode_84 {c |}{col 16}{res}{space 2}-1.985885{col 28}{space 2} .3787926{col 39}{space 1}   -5.24{col 48}{space 3}0.000{col 56}{space 4}-2.728304{col 69}{space 3}-1.243465
{txt}{space 4}cidcode_86 {c |}{col 16}{res}{space 2}-2.089404{col 28}{space 2} .3753727{col 39}{space 1}   -5.57{col 48}{space 3}0.000{col 56}{space 4}-2.825121{col 69}{space 3}-1.353687
{txt}{space 4}cidcode_87 {c |}{col 16}{res}{space 2}-2.137074{col 28}{space 2} .3720864{col 39}{space 1}   -5.74{col 48}{space 3}0.000{col 56}{space 4} -2.86635{col 69}{space 3}-1.407798
{txt}{space 4}cidcode_89 {c |}{col 16}{res}{space 2}-1.817673{col 28}{space 2} .3959034{col 39}{space 1}   -4.59{col 48}{space 3}0.000{col 56}{space 4}-2.593629{col 69}{space 3}-1.041716
{txt}{space 4}cidcode_90 {c |}{col 16}{res}{space 2}-2.036264{col 28}{space 2} .3713894{col 39}{space 1}   -5.48{col 48}{space 3}0.000{col 56}{space 4}-2.764174{col 69}{space 3}-1.308355
{txt}{space 4}cidcode_92 {c |}{col 16}{res}{space 2}-2.058307{col 28}{space 2} .3790775{col 39}{space 1}   -5.43{col 48}{space 3}0.000{col 56}{space 4}-2.801285{col 69}{space 3}-1.315329
{txt}{space 4}cidcode_93 {c |}{col 16}{res}{space 2}-2.075036{col 28}{space 2}  .367573{col 39}{space 1}   -5.65{col 48}{space 3}0.000{col 56}{space 4}-2.795466{col 69}{space 3}-1.354606
{txt}{space 4}cidcode_95 {c |}{col 16}{res}{space 2}-2.145793{col 28}{space 2} .3654092{col 39}{space 1}   -5.87{col 48}{space 3}0.000{col 56}{space 4}-2.861982{col 69}{space 3}-1.429604
{txt}{space 4}cidcode_96 {c |}{col 16}{res}{space 2}-2.066371{col 28}{space 2} .3854952{col 39}{space 1}   -5.36{col 48}{space 3}0.000{col 56}{space 4}-2.821928{col 69}{space 3}-1.310815
{txt}{space 3}cidcode_101 {c |}{col 16}{res}{space 2}-2.049526{col 28}{space 2} .3776229{col 39}{space 1}   -5.43{col 48}{space 3}0.000{col 56}{space 4}-2.789654{col 69}{space 3}-1.309399
{txt}{space 3}cidcode_102 {c |}{col 16}{res}{space 2}-2.139937{col 28}{space 2} .3594832{col 39}{space 1}   -5.95{col 48}{space 3}0.000{col 56}{space 4}-2.844511{col 69}{space 3}-1.435362
{txt}{space 3}cidcode_117 {c |}{col 16}{res}{space 2}-2.109768{col 28}{space 2} .3752809{col 39}{space 1}   -5.62{col 48}{space 3}0.000{col 56}{space 4}-2.845305{col 69}{space 3} -1.37423
{txt}{space 3}cidcode_125 {c |}{col 16}{res}{space 2}-2.115642{col 28}{space 2} .3747939{col 39}{space 1}   -5.64{col 48}{space 3}0.000{col 56}{space 4}-2.850224{col 69}{space 3}-1.381059
{txt}{space 3}cidcode_131 {c |}{col 16}{res}{space 2}-1.990928{col 28}{space 2} .3956101{col 39}{space 1}   -5.03{col 48}{space 3}0.000{col 56}{space 4} -2.76631{col 69}{space 3}-1.215547
{txt}{space 3}cidcode_134 {c |}{col 16}{res}{space 2}-1.909287{col 28}{space 2} .3846793{col 39}{space 1}   -4.96{col 48}{space 3}0.000{col 56}{space 4}-2.663244{col 69}{space 3}-1.155329
{txt}{space 3}cidcode_138 {c |}{col 16}{res}{space 2}-2.086371{col 28}{space 2}  .370322{col 39}{space 1}   -5.63{col 48}{space 3}0.000{col 56}{space 4}-2.812189{col 69}{space 3}-1.360553
{txt}{space 3}cidcode_140 {c |}{col 16}{res}{space 2}-1.981856{col 28}{space 2} .4181336{col 39}{space 1}   -4.74{col 48}{space 3}0.000{col 56}{space 4}-2.801382{col 69}{space 3}-1.162329
{txt}{space 3}cidcode_143 {c |}{col 16}{res}{space 2}-2.061375{col 28}{space 2} .3707786{col 39}{space 1}   -5.56{col 48}{space 3}0.000{col 56}{space 4}-2.788088{col 69}{space 3}-1.334662
{txt}{space 3}cidcode_145 {c |}{col 16}{res}{space 2}-2.135955{col 28}{space 2} .3757325{col 39}{space 1}   -5.68{col 48}{space 3}0.000{col 56}{space 4}-2.872377{col 69}{space 3}-1.399533
{txt}{space 3}cidcode_148 {c |}{col 16}{res}{space 2}-2.248363{col 28}{space 2} .3707821{col 39}{space 1}   -6.06{col 48}{space 3}0.000{col 56}{space 4}-2.975082{col 69}{space 3}-1.521643
{txt}{space 3}cidcode_150 {c |}{col 16}{res}{space 2}-2.076258{col 28}{space 2} .3779558{col 39}{space 1}   -5.49{col 48}{space 3}0.000{col 56}{space 4}-2.817038{col 69}{space 3}-1.335478
{txt}{space 3}cidcode_151 {c |}{col 16}{res}{space 2}-2.078955{col 28}{space 2} .3796904{col 39}{space 1}   -5.48{col 48}{space 3}0.000{col 56}{space 4}-2.823135{col 69}{space 3}-1.334776
{txt}{space 3}cidcode_152 {c |}{col 16}{res}{space 2}-2.109623{col 28}{space 2} .3797073{col 39}{space 1}   -5.56{col 48}{space 3}0.000{col 56}{space 4}-2.853836{col 69}{space 3}-1.365411
{txt}{space 3}cidcode_153 {c |}{col 16}{res}{space 2}-2.096145{col 28}{space 2} .3723528{col 39}{space 1}   -5.63{col 48}{space 3}0.000{col 56}{space 4}-2.825943{col 69}{space 3}-1.366347
{txt}{space 3}cidcode_158 {c |}{col 16}{res}{space 2}-2.206499{col 28}{space 2} .3711265{col 39}{space 1}   -5.95{col 48}{space 3}0.000{col 56}{space 4}-2.933893{col 69}{space 3}-1.479104
{txt}{space 3}cidcode_163 {c |}{col 16}{res}{space 2} -2.22251{col 28}{space 2}  .373206{col 39}{space 1}   -5.96{col 48}{space 3}0.000{col 56}{space 4} -2.95398{col 69}{space 3}-1.491039
{txt}{space 3}cidcode_172 {c |}{col 16}{res}{space 2}-2.139523{col 28}{space 2} .3773391{col 39}{space 1}   -5.67{col 48}{space 3}0.000{col 56}{space 4}-2.879094{col 69}{space 3}-1.399952
{txt}{space 3}cidcode_173 {c |}{col 16}{res}{space 2}-2.107984{col 28}{space 2} .3708749{col 39}{space 1}   -5.68{col 48}{space 3}0.000{col 56}{space 4}-2.834885{col 69}{space 3}-1.381082
{txt}{space 3}cidcode_178 {c |}{col 16}{res}{space 2}-1.631444{col 28}{space 2}  .409666{col 39}{space 1}   -3.98{col 48}{space 3}0.000{col 56}{space 4}-2.434374{col 69}{space 3} -.828513
{txt}{space 3}cidcode_180 {c |}{col 16}{res}{space 2}-2.279387{col 28}{space 2} .3798641{col 39}{space 1}   -6.00{col 48}{space 3}0.000{col 56}{space 4}-3.023907{col 69}{space 3}-1.534868
{txt}{space 3}cidcode_181 {c |}{col 16}{res}{space 2}-2.050422{col 28}{space 2} .3746174{col 39}{space 1}   -5.47{col 48}{space 3}0.000{col 56}{space 4}-2.784658{col 69}{space 3}-1.316185
{txt}{space 3}cidcode_182 {c |}{col 16}{res}{space 2}-2.097992{col 28}{space 2} .3715501{col 39}{space 1}   -5.65{col 48}{space 3}0.000{col 56}{space 4}-2.826216{col 69}{space 3}-1.369767
{txt}{space 3}cidcode_183 {c |}{col 16}{res}{space 2}-2.233923{col 28}{space 2} .3808267{col 39}{space 1}   -5.87{col 48}{space 3}0.000{col 56}{space 4} -2.98033{col 69}{space 3}-1.487517
{txt}{space 3}cidcode_187 {c |}{col 16}{res}{space 2}-2.120497{col 28}{space 2} .3702295{col 39}{space 1}   -5.73{col 48}{space 3}0.000{col 56}{space 4}-2.846134{col 69}{space 3}-1.394861
{txt}{space 3}cidcode_191 {c |}{col 16}{res}{space 2}-2.117561{col 28}{space 2} .3640192{col 39}{space 1}   -5.82{col 48}{space 3}0.000{col 56}{space 4}-2.831025{col 69}{space 3}-1.404096
{txt}{space 3}cidcode_192 {c |}{col 16}{res}{space 2}-2.145305{col 28}{space 2} .3747934{col 39}{space 1}   -5.72{col 48}{space 3}0.000{col 56}{space 4}-2.879887{col 69}{space 3}-1.410724
{txt}{space 3}cidcode_193 {c |}{col 16}{res}{space 2}-2.086136{col 28}{space 2} .3752407{col 39}{space 1}   -5.56{col 48}{space 3}0.000{col 56}{space 4}-2.821595{col 69}{space 3}-1.350678
{txt}{space 3}cidcode_198 {c |}{col 16}{res}{space 2}-2.088647{col 28}{space 2} .3683532{col 39}{space 1}   -5.67{col 48}{space 3}0.000{col 56}{space 4}-2.810606{col 69}{space 3}-1.366689
{txt}{space 3}cidcode_199 {c |}{col 16}{res}{space 2} -2.10105{col 28}{space 2} .3694182{col 39}{space 1}   -5.69{col 48}{space 3}0.000{col 56}{space 4}-2.825097{col 69}{space 3}-1.377004
{txt}{space 3}cidcode_203 {c |}{col 16}{res}{space 2}-2.142465{col 28}{space 2} .3771488{col 39}{space 1}   -5.68{col 48}{space 3}0.000{col 56}{space 4}-2.881663{col 69}{space 3}-1.403267
{txt}{space 3}cidcode_208 {c |}{col 16}{res}{space 2}-2.179503{col 28}{space 2} .3823701{col 39}{space 1}   -5.70{col 48}{space 3}0.000{col 56}{space 4}-2.928934{col 69}{space 3}-1.430071
{txt}{space 3}cidcode_209 {c |}{col 16}{res}{space 2}-2.234294{col 28}{space 2} .3779099{col 39}{space 1}   -5.91{col 48}{space 3}0.000{col 56}{space 4}-2.974983{col 69}{space 3}-1.493604
{txt}{space 9}_cons {c |}{col 16}{res}{space 2}-34.52359{col 28}{space 2} 10.01779{col 39}{space 1}   -3.45{col 48}{space 3}0.001{col 56}{space 4}-54.15811{col 69}{space 3}-14.88907
{txt}{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .2124333   .0850055     2.50   0.012{col 58} .0458256    .3790409
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  6.245{txt} ({res}0.012{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50}  7.747{txt} ({res}0.005{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60}  0.337{txt} ({res}0.561{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  0.726{txt} ({res}0.394{txt})

Acceptable range for rho: {res}-3.322 < rho < 1.000


{txt}
{com}.         restore
{txt}
{com}. 
. // Table 6
. 
.         global lhs="lnfdinores"
{txt}
{com}.         global clus =""
{txt}
{com}.         global ldv= "llnfdinores"
{txt}
{com}.         global rhs1 ="ln_poptot  openness  lnhumanav   ln_dist  trend  llngdppc lngdp_smp ftaned  rernlgdp govshare instm5i l1lnrestotval"
{txt}
{com}. 
.         do "$path\regression program.do"
{txt}
{com}. 
. preserve
{txt}
{com}.         qui reg $lhs $ldv $rhs1, robust
{txt}
{com}.         keep if e(sample)
{txt}(3256 observations deleted)

{com}.         sort year idcode
{txt}
{com}.         qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.         subsave dij* using "$path\w6.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w6.dta saved

{com}.         spatwmat using "$path\w6.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}1160x1160


{txt}
{com}.         matrix eigenvalues re im = w
{txt}
{com}.         matrix e = re'  
{txt}
{com}.         spatreg2 $lhs $ldv $rhs1 $extra, robust  w(w) e(e) model(lag) vce($clus)
{res}
{txt}initial:       log pseudolikelihood = {res}-1423.4888
{txt}rescale:       log pseudolikelihood = {res}-1423.4888
{txt}rescale eq:    log pseudolikelihood = {res}-1423.4888
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-1423.4888{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-1420.1095{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-1420.0968{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-1420.0968{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}      1160
{txt}{col 52}Variance ratio{col 68}={res}     0.925
{txt}{col 52}Squared corr.{col 68}={res}     0.925
{txt}Log likelihood = {res}-1420.0968{txt}{col 52}Sigma{col 68}={res}      0.82

{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}   lnfdinores{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores    {txt}{c |}
{space 2}llnfdinores {c |}{col 15}{res}{space 2} .7512779{col 27}{space 2} .0908651{col 38}{space 1}    8.27{col 47}{space 3}0.000{col 55}{space 4} .5731855{col 68}{space 3} .9293703
{txt}{space 4}ln_poptot {c |}{col 15}{res}{space 2} .2210169{col 27}{space 2} .0749877{col 38}{space 1}    2.95{col 47}{space 3}0.003{col 55}{space 4} .0740437{col 68}{space 3} .3679901
{txt}{space 5}openness {c |}{col 15}{res}{space 2} .1165627{col 27}{space 2} .0798256{col 38}{space 1}    1.46{col 47}{space 3}0.144{col 55}{space 4}-.0398926{col 68}{space 3} .2730181
{txt}{space 4}lnhumanav {c |}{col 15}{res}{space 2} .4093004{col 27}{space 2} .1627405{col 38}{space 1}    2.52{col 47}{space 3}0.012{col 55}{space 4} .0903348{col 68}{space 3}  .728266
{txt}{space 6}ln_dist {c |}{col 15}{res}{space 2}-.2898866{col 27}{space 2} .1072706{col 38}{space 1}   -2.70{col 47}{space 3}0.007{col 55}{space 4}-.5001332{col 68}{space 3}-.0796401
{txt}{space 8}trend {c |}{col 15}{res}{space 2} .0222139{col 27}{space 2}  .012643{col 38}{space 1}    1.76{col 47}{space 3}0.079{col 55}{space 4}-.0025659{col 68}{space 3} .0469936
{txt}{space 5}llngdppc {c |}{col 15}{res}{space 2} .1305234{col 27}{space 2} .0835745{col 38}{space 1}    1.56{col 47}{space 3}0.118{col 55}{space 4}-.0332796{col 68}{space 3} .2943263
{txt}{space 4}lngdp_smp {c |}{col 15}{res}{space 2}-.5291511{col 27}{space 2} .2463216{col 38}{space 1}   -2.15{col 47}{space 3}0.032{col 55}{space 4}-1.011933{col 68}{space 3}-.0463696
{txt}{space 7}ftaned {c |}{col 15}{res}{space 2} .2199642{col 27}{space 2} .1634104{col 38}{space 1}    1.35{col 47}{space 3}0.178{col 55}{space 4}-.1003144{col 68}{space 3} .5402427
{txt}{space 5}rernlgdp {c |}{col 15}{res}{space 2}-.1344806{col 27}{space 2} .0483256{col 38}{space 1}   -2.78{col 47}{space 3}0.005{col 55}{space 4}-.2291971{col 68}{space 3}-.0397642
{txt}{space 5}govshare {c |}{col 15}{res}{space 2}-.0168181{col 27}{space 2} .0068967{col 38}{space 1}   -2.44{col 47}{space 3}0.015{col 55}{space 4}-.0303354{col 68}{space 3}-.0033008
{txt}{space 6}instm5i {c |}{col 15}{res}{space 2} .0032039{col 27}{space 2} .0046626{col 38}{space 1}    0.69{col 47}{space 3}0.492{col 55}{space 4}-.0059346{col 68}{space 3} .0123424
{txt}l1lnrestotval {c |}{col 15}{res}{space 2}-.0170478{col 27}{space 2} .0091034{col 38}{space 1}   -1.87{col 47}{space 3}0.061{col 55}{space 4}  -.03489{col 68}{space 3} .0007944
{txt}{space 8}_cons {c |}{col 15}{res}{space 2} 2.856659{col 27}{space 2} 1.474986{col 38}{space 1}    1.94{col 47}{space 3}0.053{col 55}{space 4}-.0342602{col 68}{space 3} 5.747579
{txt}{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .1200699   .0452627     2.65   0.008{col 58} .0313566    .2087832
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  7.037{txt} ({res}0.008{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50}  7.117{txt} ({res}0.008{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60}  4.143{txt} ({res}0.042{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  0.547{txt} ({res}0.460{txt})

Acceptable range for rho: {res}-3.061 < rho < 1.000


{txt}
{com}. restore
{txt}
{com}. 
. 
{txt}end of do-file

{com}.         
.         global rhs1 ="ln_poptot  openness  lnhumanav   ln_dist  trend  llngdppc lngdp_smp ftaned  rernlgdp govshare instm5i l1lnresenval l1lnresnotenval"
{txt}
{com}.         do "$path\regression program.do"
{txt}
{com}. 
. preserve
{txt}
{com}.         qui reg $lhs $ldv $rhs1, robust
{txt}
{com}.         keep if e(sample)
{txt}(3553 observations deleted)

{com}.         sort year idcode
{txt}
{com}.         qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.         subsave dij* using "$path\w6.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w6.dta saved

{com}.         spatwmat using "$path\w6.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}863x863


{txt}
{com}.         matrix eigenvalues re im = w
{txt}
{com}.         matrix e = re'  
{txt}
{com}.         spatreg2 $lhs $ldv $rhs1 $extra, robust  w(w) e(e) model(lag) vce($clus)
{res}
{txt}initial:       log pseudolikelihood = {res}-704.25719
{txt}rescale:       log pseudolikelihood = {res}-704.25719
{txt}rescale eq:    log pseudolikelihood = {res}-704.25719
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-704.25719{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-699.21476{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-699.16934{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-699.16932{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}       863
{txt}{col 52}Variance ratio{col 68}={res}     0.962
{txt}{col 52}Squared corr.{col 68}={res}     0.962
{txt}Log likelihood = {res}-699.16932{txt}{col 52}Sigma{col 68}={res}      0.54

{txt}{hline 16}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 17}{c |}{col 29}    Robust
{col 1}     lnfdinores{col 17}{c |}      Coef.{col 29}   Std. Err.{col 41}      z{col 49}   P>|z|{col 57}     [95% Con{col 70}f. Interval]
{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores      {txt}{c |}
{space 4}llnfdinores {c |}{col 17}{res}{space 2} .7850585{col 29}{space 2} .0534584{col 40}{space 1}   14.69{col 49}{space 3}0.000{col 57}{space 4}  .680282{col 70}{space 3}  .889835
{txt}{space 6}ln_poptot {c |}{col 17}{res}{space 2} .2014484{col 29}{space 2} .0492859{col 40}{space 1}    4.09{col 49}{space 3}0.000{col 57}{space 4} .1048497{col 70}{space 3} .2980471
{txt}{space 7}openness {c |}{col 17}{res}{space 2} .0804181{col 29}{space 2} .0728871{col 40}{space 1}    1.10{col 49}{space 3}0.270{col 57}{space 4}-.0624379{col 70}{space 3} .2232742
{txt}{space 6}lnhumanav {c |}{col 17}{res}{space 2} .2839271{col 29}{space 2} .0975303{col 40}{space 1}    2.91{col 49}{space 3}0.004{col 57}{space 4} .0927712{col 70}{space 3}  .475083
{txt}{space 8}ln_dist {c |}{col 17}{res}{space 2}-.1920187{col 29}{space 2} .0700509{col 40}{space 1}   -2.74{col 49}{space 3}0.006{col 57}{space 4}-.3293159{col 70}{space 3}-.0547214
{txt}{space 10}trend {c |}{col 17}{res}{space 2} .0096594{col 29}{space 2} .0085098{col 40}{space 1}    1.14{col 49}{space 3}0.256{col 57}{space 4}-.0070196{col 70}{space 3} .0263383
{txt}{space 7}llngdppc {c |}{col 17}{res}{space 2} .1816013{col 29}{space 2} .0676653{col 40}{space 1}    2.68{col 49}{space 3}0.007{col 57}{space 4} .0489797{col 70}{space 3} .3142229
{txt}{space 6}lngdp_smp {c |}{col 17}{res}{space 2} -.252609{col 29}{space 2} .1263592{col 40}{space 1}   -2.00{col 49}{space 3}0.046{col 57}{space 4}-.5002685{col 70}{space 3}-.0049495
{txt}{space 9}ftaned {c |}{col 17}{res}{space 2} .1351384{col 29}{space 2} .0965841{col 40}{space 1}    1.40{col 49}{space 3}0.162{col 57}{space 4}-.0541631{col 70}{space 3} .3244398
{txt}{space 7}rernlgdp {c |}{col 17}{res}{space 2}-.1256705{col 29}{space 2} .0343917{col 40}{space 1}   -3.65{col 49}{space 3}0.000{col 57}{space 4} -.193077{col 70}{space 3} -.058264
{txt}{space 7}govshare {c |}{col 17}{res}{space 2}-.0141195{col 29}{space 2} .0044318{col 40}{space 1}   -3.19{col 49}{space 3}0.001{col 57}{space 4}-.0228057{col 70}{space 3}-.0054332
{txt}{space 8}instm5i {c |}{col 17}{res}{space 2} .0032967{col 29}{space 2} .0043407{col 40}{space 1}    0.76{col 49}{space 3}0.448{col 57}{space 4}-.0052109{col 70}{space 3} .0118043
{txt}{space 3}l1lnresenval {c |}{col 17}{res}{space 2}-.0185595{col 29}{space 2} .0107577{col 40}{space 1}   -1.73{col 49}{space 3}0.084{col 57}{space 4}-.0396443{col 70}{space 3} .0025252
{txt}l1lnresnotenval {c |}{col 17}{res}{space 2} .0116966{col 29}{space 2} .0095894{col 40}{space 1}    1.22{col 49}{space 3}0.223{col 57}{space 4}-.0070983{col 70}{space 3} .0304915
{txt}{space 10}_cons {c |}{col 17}{res}{space 2} .0112167{col 29}{space 2} 1.003103{col 40}{space 1}    0.01{col 49}{space 3}0.991{col 57}{space 4}-1.954829{col 70}{space 3} 1.977262
{txt}{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .1085308   .0362006     3.00   0.003{col 58}  .037579    .1794826
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  8.988{txt} ({res}0.003{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50}  9.971{txt} ({res}0.002{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60}  6.430{txt} ({res}0.011{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  2.067{txt} ({res}0.150{txt})

Acceptable range for rho: {res}-2.787 < rho < 1.000


{txt}
{com}. restore
{txt}
{com}. 
. 
{txt}end of do-file

{com}. 
.         global rhs1 ="ln_poptot  lnhumanav   ln_dist  llngdppc lngdp_smp  rernlgdp govshare l1lnresenval l1lnresnotenval"
{txt}
{com}.         do "$path\regression program.do"
{txt}
{com}. 
. preserve
{txt}
{com}.         qui reg $lhs $ldv $rhs1, robust
{txt}
{com}.         keep if e(sample)
{txt}(3501 observations deleted)

{com}.         sort year idcode
{txt}
{com}.         qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.         subsave dij* using "$path\w6.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w6.dta saved

{com}.         spatwmat using "$path\w6.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}915x915


{txt}
{com}.         matrix eigenvalues re im = w
{txt}
{com}.         matrix e = re'  
{txt}
{com}.         spatreg2 $lhs $ldv $rhs1 $extra, robust  w(w) e(e) model(lag) vce($clus)
{res}
{txt}initial:       log pseudolikelihood = {res}-780.61023
{txt}rescale:       log pseudolikelihood = {res}-780.61023
{txt}rescale eq:    log pseudolikelihood = {res}-780.61023
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-780.61023{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-771.84214{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-771.71096{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-771.71087{txt}  
Iteration 4:{col 16}log pseudolikelihood = {res}-771.71087{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}       915
{txt}{col 52}Variance ratio{col 68}={res}     0.960
{txt}{col 52}Squared corr.{col 68}={res}     0.960
{txt}Log likelihood = {res}-771.71087{txt}{col 52}Sigma{col 68}={res}      0.56

{txt}{hline 16}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 17}{c |}{col 29}    Robust
{col 1}     lnfdinores{col 17}{c |}      Coef.{col 29}   Std. Err.{col 41}      z{col 49}   P>|z|{col 57}     [95% Con{col 70}f. Interval]
{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores      {txt}{c |}
{space 4}llnfdinores {c |}{col 17}{res}{space 2} .8095492{col 29}{space 2}  .045066{col 40}{space 1}   17.96{col 49}{space 3}0.000{col 57}{space 4} .7212215{col 70}{space 3} .8978769
{txt}{space 6}ln_poptot {c |}{col 17}{res}{space 2} .1747477{col 29}{space 2} .0422551{col 40}{space 1}    4.14{col 49}{space 3}0.000{col 57}{space 4} .0919293{col 70}{space 3} .2575661
{txt}{space 6}lnhumanav {c |}{col 17}{res}{space 2} .3033363{col 29}{space 2} .0872583{col 40}{space 1}    3.48{col 49}{space 3}0.001{col 57}{space 4} .1323131{col 70}{space 3} .4743595
{txt}{space 8}ln_dist {c |}{col 17}{res}{space 2} -.172212{col 29}{space 2} .0504526{col 40}{space 1}   -3.41{col 49}{space 3}0.001{col 57}{space 4}-.2710973{col 70}{space 3}-.0733268
{txt}{space 7}llngdppc {c |}{col 17}{res}{space 2} .1634851{col 29}{space 2} .0569768{col 40}{space 1}    2.87{col 49}{space 3}0.004{col 57}{space 4} .0518126{col 70}{space 3} .2751576
{txt}{space 6}lngdp_smp {c |}{col 17}{res}{space 2}-.1965777{col 29}{space 2} .1020561{col 40}{space 1}   -1.93{col 49}{space 3}0.054{col 57}{space 4} -.396604{col 70}{space 3} .0034486
{txt}{space 7}rernlgdp {c |}{col 17}{res}{space 2}-.1209174{col 29}{space 2}  .031585{col 40}{space 1}   -3.83{col 49}{space 3}0.000{col 57}{space 4}-.1828229{col 70}{space 3}-.0590119
{txt}{space 7}govshare {c |}{col 17}{res}{space 2} -.012635{col 29}{space 2} .0039102{col 40}{space 1}   -3.23{col 49}{space 3}0.001{col 57}{space 4}-.0202988{col 70}{space 3}-.0049712
{txt}{space 3}l1lnresenval {c |}{col 17}{res}{space 2}-.0264018{col 29}{space 2} .0107923{col 40}{space 1}   -2.45{col 49}{space 3}0.014{col 57}{space 4}-.0475544{col 70}{space 3}-.0052493
{txt}l1lnresnotenval {c |}{col 17}{res}{space 2} .0050459{col 29}{space 2} .0087079{col 40}{space 1}    0.58{col 49}{space 3}0.562{col 57}{space 4}-.0120214{col 70}{space 3} .0221131
{txt}{space 10}_cons {c |}{col 17}{res}{space 2} .1694488{col 29}{space 2} .9149754{col 40}{space 1}    0.19{col 49}{space 3}0.853{col 57}{space 4} -1.62387{col 70}{space 3} 1.962768
{txt}{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .1418974   .0393381     3.61   0.000{col 58} .0647962    .2189986
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50} 13.011{txt} ({res}0.000{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50} 18.031{txt} ({res}0.000{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60} 13.074{txt} ({res}0.000{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  1.747{txt} ({res}0.186{txt})

Acceptable range for rho: {res}-2.961 < rho < 1.000


{txt}
{com}. restore
{txt}
{com}. 
. 
{txt}end of do-file

{com}. 
.         global rhs1 ="ln_poptot  lnhumanav   ln_dist  llngdppc lngdp_smp  rernlgdp govshare l1lnresenval "
{txt}
{com}.         do "$path\regression program.do"
{txt}
{com}. 
. preserve
{txt}
{com}.         qui reg $lhs $ldv $rhs1, robust
{txt}
{com}.         keep if e(sample)
{txt}(3331 observations deleted)

{com}.         sort year idcode
{txt}
{com}.         qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.         subsave dij* using "$path\w6.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w6.dta saved

{com}.         spatwmat using "$path\w6.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}1085x1085


{txt}
{com}.         matrix eigenvalues re im = w
{txt}
{com}.         matrix e = re'  
{txt}
{com}.         spatreg2 $lhs $ldv $rhs1 $extra, robust  w(w) e(e) model(lag) vce($clus)
{res}
{txt}initial:       log pseudolikelihood = {res}-975.78486
{txt}rescale:       log pseudolikelihood = {res}-975.78486
{txt}rescale eq:    log pseudolikelihood = {res}-975.78486
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-975.78486{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-962.98705{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-962.74339{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-962.74312{txt}  
Iteration 4:{col 16}log pseudolikelihood = {res}-962.74312{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}      1085
{txt}{col 52}Variance ratio{col 68}={res}     0.965
{txt}{col 52}Squared corr.{col 68}={res}     0.965
{txt}Log likelihood = {res}-962.74312{txt}{col 52}Sigma{col 68}={res}      0.59

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  lnfdinores{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores   {txt}{c |}
{space 1}llnfdinores {c |}{col 14}{res}{space 2} .8312982{col 26}{space 2} .0343886{col 37}{space 1}   24.17{col 46}{space 3}0.000{col 54}{space 4} .7638979{col 67}{space 3} .8986985
{txt}{space 3}ln_poptot {c |}{col 14}{res}{space 2} .1683948{col 26}{space 2} .0355587{col 37}{space 1}    4.74{col 46}{space 3}0.000{col 54}{space 4} .0987012{col 67}{space 3} .2380885
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} .3717783{col 26}{space 2} .0934772{col 37}{space 1}    3.98{col 46}{space 3}0.000{col 54}{space 4} .1885663{col 67}{space 3} .5549903
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2}-.1806757{col 26}{space 2} .0474096{col 37}{space 1}   -3.81{col 46}{space 3}0.000{col 54}{space 4}-.2735968{col 67}{space 3}-.0877546
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2} .0988684{col 26}{space 2} .0425714{col 37}{space 1}    2.32{col 46}{space 3}0.020{col 54}{space 4} .0154299{col 67}{space 3} .1823068
{txt}{space 3}lngdp_smp {c |}{col 14}{res}{space 2}-.3036563{col 26}{space 2} .0980824{col 37}{space 1}   -3.10{col 46}{space 3}0.002{col 54}{space 4}-.4958942{col 67}{space 3}-.1114184
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2}-.1049584{col 26}{space 2} .0264389{col 37}{space 1}   -3.97{col 46}{space 3}0.000{col 54}{space 4}-.1567777{col 67}{space 3}-.0531392
{txt}{space 4}govshare {c |}{col 14}{res}{space 2}-.0093416{col 26}{space 2} .0030195{col 37}{space 1}   -3.09{col 46}{space 3}0.002{col 54}{space 4}-.0152597{col 67}{space 3}-.0034236
{txt}l1lnresenval {c |}{col 14}{res}{space 2}-.0214188{col 26}{space 2} .0086733{col 37}{space 1}   -2.47{col 46}{space 3}0.014{col 54}{space 4}-.0384181{col 67}{space 3}-.0044195
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 1.262824{col 26}{space 2} .8622188{col 37}{space 1}    1.46{col 46}{space 3}0.143{col 54}{space 4}-.4270939{col 67}{space 3} 2.952742
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .1498836   .0346113     4.33   0.000{col 58} .0820468    .2177205
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50} 18.753{txt} ({res}0.000{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50} 27.494{txt} ({res}0.000{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60} 19.003{txt} ({res}0.000{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  5.125{txt} ({res}0.024{txt})

Acceptable range for rho: {res}-3.261 < rho < 1.000


{txt}
{com}. restore
{txt}
{com}. 
. 
{txt}end of do-file

{com}. 
.         global rhs1 ="ln_poptot  lnhumanav   ln_dist  llngdppc lngdp_smp  rernlgdp govshare l1lnresenbpval oilprice_usd2008 "
{txt}
{com}.         do "$path\regression program.do"
{txt}
{com}. 
. preserve
{txt}
{com}.         qui reg $lhs $ldv $rhs1, robust
{txt}
{com}.         keep if e(sample)
{txt}(3477 observations deleted)

{com}.         sort year idcode
{txt}
{com}.         qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.         subsave dij* using "$path\w6.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w6.dta saved

{com}.         spatwmat using "$path\w6.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}939x939


{txt}
{com}.         matrix eigenvalues re im = w
{txt}
{com}.         matrix e = re'  
{txt}
{com}.         spatreg2 $lhs $ldv $rhs1 $extra, robust  w(w) e(e) model(lag) vce($clus)
{res}
{txt}initial:       log pseudolikelihood = {res}-804.06074
{txt}rescale:       log pseudolikelihood = {res}-804.06074
{txt}rescale eq:    log pseudolikelihood = {res}-804.06074
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-804.06074{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-797.61485{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-797.55062{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res} -797.5506{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}       939
{txt}{col 52}Variance ratio{col 68}={res}     0.966
{txt}{col 52}Squared corr.{col 68}={res}     0.966
{txt}Log likelihood = {res}-797.5506{txt}{col 52}Sigma{col 68}={res}      0.57

{txt}{hline 17}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 18}{c |}{col 30}    Robust
{col 1}      lnfdinores{col 18}{c |}      Coef.{col 30}   Std. Err.{col 42}      z{col 50}   P>|z|{col 58}     [95% Con{col 71}f. Interval]
{hline 17}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores       {txt}{c |}
{space 5}llnfdinores {c |}{col 18}{res}{space 2} .8539179{col 30}{space 2} .0312877{col 41}{space 1}   27.29{col 50}{space 3}0.000{col 58}{space 4} .7925952{col 71}{space 3} .9152406
{txt}{space 7}ln_poptot {c |}{col 18}{res}{space 2} .1354457{col 30}{space 2} .0304336{col 41}{space 1}    4.45{col 50}{space 3}0.000{col 58}{space 4} .0757969{col 71}{space 3} .1950944
{txt}{space 7}lnhumanav {c |}{col 18}{res}{space 2} .3231661{col 30}{space 2} .1048476{col 41}{space 1}    3.08{col 50}{space 3}0.002{col 58}{space 4} .1176687{col 71}{space 3} .5286636
{txt}{space 9}ln_dist {c |}{col 18}{res}{space 2}-.1298109{col 30}{space 2} .0374886{col 41}{space 1}   -3.46{col 50}{space 3}0.001{col 58}{space 4}-.2032872{col 71}{space 3}-.0563347
{txt}{space 8}llngdppc {c |}{col 18}{res}{space 2} .1014407{col 30}{space 2} .0464439{col 41}{space 1}    2.18{col 50}{space 3}0.029{col 58}{space 4} .0104125{col 71}{space 3}  .192469
{txt}{space 7}lngdp_smp {c |}{col 18}{res}{space 2}-.1856977{col 30}{space 2} .0850205{col 41}{space 1}   -2.18{col 50}{space 3}0.029{col 58}{space 4}-.3523348{col 71}{space 3}-.0190606
{txt}{space 8}rernlgdp {c |}{col 18}{res}{space 2}-.0878623{col 30}{space 2} .0267731{col 41}{space 1}   -3.28{col 50}{space 3}0.001{col 58}{space 4}-.1403365{col 71}{space 3}-.0353881
{txt}{space 8}govshare {c |}{col 18}{res}{space 2}-.0097324{col 30}{space 2} .0034418{col 41}{space 1}   -2.83{col 50}{space 3}0.005{col 58}{space 4}-.0164782{col 71}{space 3}-.0029866
{txt}{space 2}l1lnresenbpval {c |}{col 18}{res}{space 2}-.0181407{col 30}{space 2} .0105882{col 41}{space 1}   -1.71{col 50}{space 3}0.087{col 58}{space 4}-.0388933{col 71}{space 3} .0026118
{txt}oilprice_usd2008 {c |}{col 18}{res}{space 2}-.0059143{col 30}{space 2} .0021474{col 41}{space 1}   -2.75{col 50}{space 3}0.006{col 58}{space 4} -.010123{col 71}{space 3}-.0017055
{txt}{space 11}_cons {c |}{col 18}{res}{space 2}  .443141{col 30}{space 2} .8471732{col 41}{space 1}    0.52{col 50}{space 3}0.601{col 58}{space 4}-1.217288{col 71}{space 3}  2.10357
{txt}{hline 17}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .1041822   .0339225     3.07   0.002{col 58} .0376954     .170669
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  9.432{txt} ({res}0.002{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50} 13.328{txt} ({res}0.000{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60} 11.468{txt} ({res}0.001{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  0.228{txt} ({res}0.633{txt})

Acceptable range for rho: {res}-3.088 < rho < 1.000


{txt}
{com}. restore
{txt}
{com}. 
. 
{txt}end of do-file

{com}. 
.         
. // Table 7
. 
.                 global lhs="lnfdinores"
{txt}
{com}.                 global rhs1 ="ln_poptot   lnhumanav   ln_dist  trend  llngdppc lngdp_smp  rernlgdp govshare  "
{txt}
{com}.                 global ldv= "llnfdinores"
{txt}
{com}.                 global sel = "openness  landlock "
{txt}
{com}.         preserve
{txt}
{com}.                 gen s= .
{txt}(4416 missing values generated)

{com}.                 replace s =1 if fdinores!=0 & fdinores!=.
{txt}(2754 real changes made)

{com}.                 replace s =0 if fdinores==0 
{txt}(723 real changes made)

{com}.                 qui probit s $rhs1 $sel l1restotdum, robust
{txt}
{com}.                 keep if e(sample)
{txt}(2574 observations deleted)

{com}.                 sort t idcode
{txt}
{com}.                 outsheet s $rhs1 $sel l1restotdum using "$path\matlab programs\mdata.txt" , replace comma
{txt}
{com}.                 sort t idcode
{txt}
{com}.                 qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.                 outsheet dij* using "$path\Matlab programs\W.txt", replace comma
{txt}(note: file H:\DNB\met Rick Dutch FDI\REStat replication\Matlab programs\W.txt not found)

{com}.                 save "$path\temp.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\temp.dta saved

{com}.                 set more on
{txt}
{com}.                 more 
{txt}
{com}.                 ** run spatialprobit.m in matlab to create yhatar.txt, the predicted probabilities of the first stage (or use the file provided and continue)
.                 ** Note: install Le Sage's spatial econometrics package first
.                 ** spatialprobit.m uses sarp_g.m version 4 August 2009.
.                 
.                 clear all
{txt}
{com}.                 insheet using "$path\Matlab programs\yhatar.txt",  comma
{txt}(1 var, 1842 obs)

{com}.                 mkmat v1, mat(yhatar)
{res}{txt}
{com}.                 use "$path\temp.dta", clear
{txt}
{com}.                 svmat yhatar, n(p)
{txt}
{com}.                 generate phi = (1/sqrt(2*_pi))*exp(-(p1^2/2))  /*standardize it*/
{txt}
{com}.                 generate capphi = normal(p1)
{txt}
{com}.                 generate invmills = phi/capphi
{txt}
{com}.                 label var invmills "Inverse Mill's ratio"
{txt}
{com}.                 qui reg $lhs $ldv $rhs1 $sel invmills l1lnresenval
{txt}
{com}.                 keep if e(sample)
{txt}(793 observations deleted)

{com}.                 sort t idcode
{txt}
{com}.                 qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.                 subsave dij* using "$path\w.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w.dta saved

{com}.                 spatwmat using "$path\w.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}1049x1049


{txt}
{com}.                 matrix eigenvalues re im = w
{txt}
{com}.                 matrix e = re'
{txt}
{com}.                 capture run "$path\spatreg2.ado"
{txt}
{com}.                 spatreg2 $lhs $ldv $rhs1 $sel l1lnresenval, robust w(w) e(e) model(lag)
{res}
{txt}initial:       log pseudolikelihood = {res} -918.8151
{txt}rescale:       log pseudolikelihood = {res} -918.8151
{txt}rescale eq:    log pseudolikelihood = {res} -918.8151
{txt}Iteration 0:{col 16}log pseudolikelihood = {res} -918.8151{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-913.38129{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-913.34235{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-913.34234{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}      1049
{txt}{col 52}Variance ratio{col 68}={res}     0.965
{txt}{col 52}Squared corr.{col 68}={res}     0.965
{txt}Log likelihood = {res}-913.34234{txt}{col 52}Sigma{col 68}={res}      0.58

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  lnfdinores{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores   {txt}{c |}
{space 1}llnfdinores {c |}{col 14}{res}{space 2} .8231764{col 26}{space 2} .0392395{col 37}{space 1}   20.98{col 46}{space 3}0.000{col 54}{space 4} .7462685{col 67}{space 3} .9000843
{txt}{space 3}ln_poptot {c |}{col 14}{res}{space 2} .1757127{col 26}{space 2} .0424087{col 37}{space 1}    4.14{col 46}{space 3}0.000{col 54}{space 4} .0925932{col 67}{space 3} .2588322
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} .3515436{col 26}{space 2} .0938627{col 37}{space 1}    3.75{col 46}{space 3}0.000{col 54}{space 4} .1675761{col 67}{space 3}  .535511
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2}-.2245569{col 26}{space 2} .0693024{col 37}{space 1}   -3.24{col 46}{space 3}0.001{col 54}{space 4}-.3603871{col 67}{space 3}-.0887267
{txt}{space 7}trend {c |}{col 14}{res}{space 2}  .008664{col 26}{space 2} .0069464{col 37}{space 1}    1.25{col 46}{space 3}0.212{col 54}{space 4}-.0049507{col 67}{space 3} .0222787
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2} .1520183{col 26}{space 2} .0608526{col 37}{space 1}    2.50{col 46}{space 3}0.012{col 54}{space 4} .0327493{col 67}{space 3} .2712873
{txt}{space 3}lngdp_smp {c |}{col 14}{res}{space 2}-.3587052{col 26}{space 2}   .12542{col 37}{space 1}   -2.86{col 46}{space 3}0.004{col 54}{space 4} -.604524{col 67}{space 3}-.1128864
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2}-.1186341{col 26}{space 2} .0290766{col 37}{space 1}   -4.08{col 46}{space 3}0.000{col 54}{space 4}-.1756232{col 67}{space 3}-.0616451
{txt}{space 4}govshare {c |}{col 14}{res}{space 2}-.0088264{col 26}{space 2} .0032507{col 37}{space 1}   -2.72{col 46}{space 3}0.007{col 54}{space 4}-.0151977{col 67}{space 3}-.0024551
{txt}{space 4}openness {c |}{col 14}{res}{space 2} .0129836{col 26}{space 2} .0640678{col 37}{space 1}    0.20{col 46}{space 3}0.839{col 54}{space 4}-.1125869{col 67}{space 3} .1385541
{txt}{space 4}landlock {c |}{col 14}{res}{space 2} .0162078{col 26}{space 2} .0835088{col 37}{space 1}    0.19{col 46}{space 3}0.846{col 54}{space 4}-.1474665{col 67}{space 3} .1798821
{txt}l1lnresenval {c |}{col 14}{res}{space 2}-.0195787{col 26}{space 2} .0089641{col 37}{space 1}   -2.18{col 46}{space 3}0.029{col 54}{space 4}-.0371481{col 67}{space 3}-.0020094
{txt}{space 7}_cons {c |}{col 14}{res}{space 2}  1.51394{col 26}{space 2}  1.09047{col 37}{space 1}    1.39{col 46}{space 3}0.165{col 54}{space 4} -.623342{col 67}{space 3} 3.651221
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .1097083   .0366547     2.99   0.003{col 58} .0378664    .1815501
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  8.958{txt} ({res}0.003{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50} 11.316{txt} ({res}0.001{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60}  5.467{txt} ({res}0.019{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  6.592{txt} ({res}0.010{txt})

Acceptable range for rho: {res}-3.133 < rho < 1.000


{txt}
{com}.                 spatreg2 $lhs $ldv $rhs1  invmills              l1lnresenval, robust w(w) e(e) model(lag)
{res}
{txt}initial:       log pseudolikelihood = {res}-915.51552
{txt}rescale:       log pseudolikelihood = {res}-915.51552
{txt}rescale eq:    log pseudolikelihood = {res}-915.51552
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-915.51552{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-910.40198{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res} -910.3684{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-910.36839{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}      1049
{txt}{col 52}Variance ratio{col 68}={res}     0.965
{txt}{col 52}Squared corr.{col 68}={res}     0.965
{txt}Log likelihood = {res}-910.36839{txt}{col 52}Sigma{col 68}={res}      0.58

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  lnfdinores{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores   {txt}{c |}
{space 1}llnfdinores {c |}{col 14}{res}{space 2} .8178889{col 26}{space 2} .0402086{col 37}{space 1}   20.34{col 46}{space 3}0.000{col 54}{space 4} .7390814{col 67}{space 3} .8966963
{txt}{space 3}ln_poptot {c |}{col 14}{res}{space 2} .1822903{col 26}{space 2} .0421926{col 37}{space 1}    4.32{col 46}{space 3}0.000{col 54}{space 4} .0995944{col 67}{space 3} .2649862
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} .3868295{col 26}{space 2} .1028362{col 37}{space 1}    3.76{col 46}{space 3}0.000{col 54}{space 4} .1852743{col 67}{space 3} .5883846
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2}-.2084814{col 26}{space 2} .0659347{col 37}{space 1}   -3.16{col 46}{space 3}0.002{col 54}{space 4} -.337711{col 67}{space 3}-.0792518
{txt}{space 7}trend {c |}{col 14}{res}{space 2} .0119859{col 26}{space 2} .0073384{col 37}{space 1}    1.63{col 46}{space 3}0.102{col 54}{space 4}-.0023971{col 67}{space 3} .0263689
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2} .1669415{col 26}{space 2} .0584371{col 37}{space 1}    2.86{col 46}{space 3}0.004{col 54}{space 4} .0524069{col 67}{space 3} .2814761
{txt}{space 3}lngdp_smp {c |}{col 14}{res}{space 2} -.320495{col 26}{space 2} .1192257{col 37}{space 1}   -2.69{col 46}{space 3}0.007{col 54}{space 4}-.5541732{col 67}{space 3}-.0868169
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2}-.1141453{col 26}{space 2} .0276156{col 37}{space 1}   -4.13{col 46}{space 3}0.000{col 54}{space 4}-.1682709{col 67}{space 3}-.0600196
{txt}{space 4}govshare {c |}{col 14}{res}{space 2}-.0109126{col 26}{space 2} .0037366{col 37}{space 1}   -2.92{col 46}{space 3}0.003{col 54}{space 4}-.0182361{col 67}{space 3} -.003589
{txt}{space 4}invmills {c |}{col 14}{res}{space 2} .5883649{col 26}{space 2} .3526379{col 37}{space 1}    1.67{col 46}{space 3}0.095{col 54}{space 4}-.1027928{col 67}{space 3} 1.279523
{txt}l1lnresenval {c |}{col 14}{res}{space 2}-.0178953{col 26}{space 2} .0089324{col 37}{space 1}   -2.00{col 46}{space 3}0.045{col 54}{space 4}-.0354024{col 67}{space 3}-.0003882
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .8596832{col 26}{space 2} 1.045723{col 37}{space 1}    0.82{col 46}{space 3}0.411{col 54}{space 4}-1.189897{col 67}{space 3} 2.909263
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .1056295   .0340443     3.10   0.002{col 58} .0389039    .1723551
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  9.627{txt} ({res}0.002{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50} 10.642{txt} ({res}0.001{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60}  5.005{txt} ({res}0.025{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  6.832{txt} ({res}0.009{txt})

Acceptable range for rho: {res}-3.133 < rho < 1.000


{txt}
{com}.                 gen p12=p1^2
{txt}
{com}.                 gen p13=p1^3
{txt}
{com}.                 gen p14=p1^4
{txt}
{com}.                 bootstrap, reps(200): spatreg2 $lhs $ldv $rhs1  invmills p1 p12 p13     l1lnresenval    , robust w(w) e(e) model(lag)
{txt}(running spatreg2 on estimation sample)

Bootstrap replications ({res}200{txt})
{hline 4}{c +}{hline 3} 1 {hline 3}{c +}{hline 3} 2 {hline 3}{c +}{hline 3} 3 {hline 3}{c +}{hline 3} 4 {hline 3}{c +}{hline 3} 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
{res}
{txt}Spatial lag model{col 49}Number of obs{col 68}= {res}     1049
{txt}{col 49}Replications{col 68}= {res}      200
{txt}{col 49}Wald chi2({res}14{txt}){col 68}= {res} 34108.51
{txt}Log pseudolikelihood = {res}-908.92869{txt}{col 49}Prob > chi2{col 68}= {res}   0.0000

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}   Observed{col 26}   Bootstrap{col 54}         Norm{col 67}al-based
{col 1}  lnfdinores{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores   {txt}{c |}
{space 1}llnfdinores {c |}{col 14}{res}{space 2} .8165269{col 26}{space 2} .0408029{col 37}{space 1}   20.01{col 46}{space 3}0.000{col 54}{space 4} .7365547{col 67}{space 3}  .896499
{txt}{space 3}ln_poptot {c |}{col 14}{res}{space 2} .1775188{col 26}{space 2}  .051297{col 37}{space 1}    3.46{col 46}{space 3}0.001{col 54}{space 4} .0769785{col 67}{space 3} .2780591
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} .3746621{col 26}{space 2} .1048524{col 37}{space 1}    3.57{col 46}{space 3}0.000{col 54}{space 4} .1691553{col 67}{space 3}  .580169
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2}-.2366785{col 26}{space 2} .1075255{col 37}{space 1}   -2.20{col 46}{space 3}0.028{col 54}{space 4}-.4474246{col 67}{space 3}-.0259323
{txt}{space 7}trend {c |}{col 14}{res}{space 2} .0070552{col 26}{space 2} .0147885{col 37}{space 1}    0.48{col 46}{space 3}0.633{col 54}{space 4}-.0219297{col 67}{space 3} .0360401
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2} .1513372{col 26}{space 2} .0967795{col 37}{space 1}    1.56{col 46}{space 3}0.118{col 54}{space 4}-.0383471{col 67}{space 3} .3410214
{txt}{space 3}lngdp_smp {c |}{col 14}{res}{space 2}-.3504439{col 26}{space 2} .1529209{col 37}{space 1}   -2.29{col 46}{space 3}0.022{col 54}{space 4}-.6501633{col 67}{space 3}-.0507245
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2}-.1288853{col 26}{space 2} .0520956{col 37}{space 1}   -2.47{col 46}{space 3}0.013{col 54}{space 4}-.2309908{col 67}{space 3}-.0267798
{txt}{space 4}govshare {c |}{col 14}{res}{space 2}-.0091184{col 26}{space 2} .0056333{col 37}{space 1}   -1.62{col 46}{space 3}0.106{col 54}{space 4}-.0201594{col 67}{space 3} .0019225
{txt}{space 4}invmills {c |}{col 14}{res}{space 2} 1.591292{col 26}{space 2}  1.13622{col 37}{space 1}    1.40{col 46}{space 3}0.161{col 54}{space 4} -.635659{col 67}{space 3} 3.818243
{txt}{space 10}p1 {c |}{col 14}{res}{space 2} .4934751{col 26}{space 2} .7201232{col 37}{space 1}    0.69{col 46}{space 3}0.493{col 54}{space 4}-.9179405{col 67}{space 3} 1.904891
{txt}{space 9}p12 {c |}{col 14}{res}{space 2}-.0932922{col 26}{space 2}  .168677{col 37}{space 1}   -0.55{col 46}{space 3}0.580{col 54}{space 4}-.4238932{col 67}{space 3} .2373087
{txt}{space 9}p13 {c |}{col 14}{res}{space 2} .0056999{col 26}{space 2} .0133551{col 37}{space 1}    0.43{col 46}{space 3}0.670{col 54}{space 4}-.0204756{col 67}{space 3} .0318754
{txt}l1lnresenval {c |}{col 14}{res}{space 2}-.0179082{col 26}{space 2} .0086861{col 37}{space 1}   -2.06{col 46}{space 3}0.039{col 54}{space 4}-.0349326{col 67}{space 3}-.0008837
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .7467319{col 26}{space 2} 2.176129{col 37}{space 1}    0.34{col 46}{space 3}0.731{col 54}{space 4}-3.518404{col 67}{space 3} 5.011867
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}rho          {txt}{c |}
{space 7}_cons {c |}{col 14}{res}{space 2} .1072382{col 26}{space 2} .0317442{col 37}{space 1}    3.38{col 46}{space 3}0.001{col 54}{space 4} .0450207{col 67}{space 3} .1694558
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}sigma        {txt}{c |}
{space 7}_cons {c |}{col 14}{res}{space 2} .5753806{col 26}{space 2} .0480115{col 37}{space 1}   11.98{col 46}{space 3}0.000{col 54}{space 4} .4812798{col 67}{space 3} .6694814
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
.         restore
{txt}
{com}. 
. 
. // Table 8
. 
.         global lhs="lnfdires"
{txt}
{com}.         global clus =""
{txt}
{com}.         global ldv= "llnfdires"
{txt}
{com}.         global rhs1 ="ln_poptot     lnhumanav   ln_dist   llngdppc lngdp_smp    rernlgdp govshare instm5i  l1lnresenval l1lnresnotenval "
{txt}
{com}.         do "$path\regression program.do"
{txt}
{com}. 
. preserve
{txt}
{com}.         qui reg $lhs $ldv $rhs1, robust
{txt}
{com}.         keep if e(sample)
{txt}(3700 observations deleted)

{com}.         sort year idcode
{txt}
{com}.         qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}.         subsave dij* using "$path\w6.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w6.dta saved

{com}.         spatwmat using "$path\w6.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}716x716


{txt}
{com}.         matrix eigenvalues re im = w
{txt}
{com}.         matrix e = re'  
{txt}
{com}.         spatreg2 $lhs $ldv $rhs1 $extra, robust  w(w) e(e) model(lag) vce($clus)
{res}
{txt}initial:       log pseudolikelihood = {res}-1004.1717
{txt}rescale:       log pseudolikelihood = {res}-1004.1717
{txt}rescale eq:    log pseudolikelihood = {res}-1004.1717
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-1004.1717{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-1003.4018{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-1003.4005{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-1003.4005{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}       716
{txt}{col 52}Variance ratio{col 68}={res}     0.863
{txt}{col 52}Squared corr.{col 68}={res}     0.863
{txt}Log likelihood = {res}-1003.4005{txt}{col 52}Sigma{col 68}={res}      0.98

{txt}{hline 16}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 17}{c |}{col 29}    Robust
{col 1}       lnfdires{col 17}{c |}      Coef.{col 29}   Std. Err.{col 41}      z{col 49}   P>|z|{col 57}     [95% Con{col 70}f. Interval]
{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdires        {txt}{c |}
{space 6}llnfdires {c |}{col 17}{res}{space 2}  .831476{col 29}{space 2} .0343108{col 40}{space 1}   24.23{col 49}{space 3}0.000{col 57}{space 4}  .764228{col 70}{space 3}  .898724
{txt}{space 6}ln_poptot {c |}{col 17}{res}{space 2} .0707414{col 29}{space 2} .0358118{col 40}{space 1}    1.98{col 49}{space 3}0.048{col 57}{space 4} .0005516{col 70}{space 3} .1409312
{txt}{space 6}lnhumanav {c |}{col 17}{res}{space 2} .3926736{col 29}{space 2}  .156799{col 40}{space 1}    2.50{col 49}{space 3}0.012{col 57}{space 4} .0853532{col 70}{space 3} .6999941
{txt}{space 8}ln_dist {c |}{col 17}{res}{space 2}-.1507823{col 29}{space 2} .0630915{col 40}{space 1}   -2.39{col 49}{space 3}0.017{col 57}{space 4}-.2744395{col 70}{space 3}-.0271252
{txt}{space 7}llngdppc {c |}{col 17}{res}{space 2}-.1627764{col 29}{space 2} .0909102{col 40}{space 1}   -1.79{col 49}{space 3}0.073{col 57}{space 4}-.3409571{col 70}{space 3} .0154042
{txt}{space 6}lngdp_smp {c |}{col 17}{res}{space 2}-.0831119{col 29}{space 2} .1301593{col 40}{space 1}   -0.64{col 49}{space 3}0.523{col 57}{space 4}-.3382194{col 70}{space 3} .1719956
{txt}{space 7}rernlgdp {c |}{col 17}{res}{space 2}-.0553287{col 29}{space 2} .0306136{col 40}{space 1}   -1.81{col 49}{space 3}0.071{col 57}{space 4}-.1153304{col 70}{space 3} .0046729
{txt}{space 7}govshare {c |}{col 17}{res}{space 2}-.0082853{col 29}{space 2} .0074013{col 40}{space 1}   -1.12{col 49}{space 3}0.263{col 57}{space 4}-.0227917{col 70}{space 3} .0062211
{txt}{space 8}instm5i {c |}{col 17}{res}{space 2} .0199755{col 29}{space 2} .0110164{col 40}{space 1}    1.81{col 49}{space 3}0.070{col 57}{space 4}-.0016162{col 70}{space 3} .0415672
{txt}{space 3}l1lnresenval {c |}{col 17}{res}{space 2} .0477176{col 29}{space 2} .0131123{col 40}{space 1}    3.64{col 49}{space 3}0.000{col 57}{space 4}  .022018{col 70}{space 3} .0734172
{txt}l1lnresnotenval {c |}{col 17}{res}{space 2}  .000464{col 29}{space 2} .0235909{col 40}{space 1}    0.02{col 49}{space 3}0.984{col 57}{space 4}-.0457734{col 70}{space 3} .0467013
{txt}{space 10}_cons {c |}{col 17}{res}{space 2}  1.01038{col 29}{space 2}  1.59579{col 40}{space 1}    0.63{col 49}{space 3}0.527{col 57}{space 4} -2.11731{col 70}{space 3} 4.138071
{txt}{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .0832296   .0707199     1.18   0.239{col 58} -.055379    .2218381
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50}  1.385{txt} ({res}0.239{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50}  1.357{txt} ({res}0.244{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60}  0.047{txt} ({res}0.828{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  1.460{txt} ({res}0.227{txt})

Acceptable range for rho: {res}-3.272 < rho < 1.000


{txt}
{com}. restore
{txt}
{com}. 
. 
{txt}end of do-file

{com}. 
.         global rhs1 ="ln_poptot     lnhumanav   ln_dist   llngdppc     rernlgdp   instm5i  l1lnresenval  "
{txt}
{com}.         reg $lhs $ldv $rhs1, robust 

{txt}Linear regression                                      Number of obs ={res}     803
                                                       {txt}F(  8,   794) ={res}  454.26
                                                       {txt}Prob > F      = {res} 0.0000
                                                       {txt}R-squared     = {res} 0.8711
                                                       {txt}Root MSE      = {res} .96976

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}    lnfdires{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}llnfdires {c |}{col 14}{res}{space 2} .8520112{col 26}{space 2} .0291791{col 37}{space 1}   29.20{col 46}{space 3}0.000{col 54}{space 4} .7947338{col 67}{space 3} .9092885
{txt}{space 3}ln_poptot {c |}{col 14}{res}{space 2}  .069775{col 26}{space 2} .0329119{col 37}{space 1}    2.12{col 46}{space 3}0.034{col 54}{space 4} .0051704{col 67}{space 3} .1343795
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} .3646158{col 26}{space 2} .1474095{col 37}{space 1}    2.47{col 46}{space 3}0.014{col 54}{space 4} .0752575{col 67}{space 3} .6539742
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2} -.122578{col 26}{space 2} .0375626{col 37}{space 1}   -3.26{col 46}{space 3}0.001{col 54}{space 4}-.1963119{col 67}{space 3}-.0488442
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2}-.1234348{col 26}{space 2} .0787773{col 37}{space 1}   -1.57{col 46}{space 3}0.118{col 54}{space 4}-.2780712{col 67}{space 3} .0312017
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2} -.063376{col 26}{space 2} .0297378{col 37}{space 1}   -2.13{col 46}{space 3}0.033{col 54}{space 4}-.1217501{col 67}{space 3}-.0050019
{txt}{space 5}instm5i {c |}{col 14}{res}{space 2} .0170269{col 26}{space 2} .0095382{col 37}{space 1}    1.79{col 46}{space 3}0.075{col 54}{space 4}-.0016962{col 67}{space 3} .0357499
{txt}l1lnresenval {c |}{col 14}{res}{space 2} .0307566{col 26}{space 2}  .011592{col 37}{space 1}    2.65{col 46}{space 3}0.008{col 54}{space 4}  .008002{col 67}{space 3} .0535112
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .4613565{col 26}{space 2} .6859496{col 37}{space 1}    0.67{col 46}{space 3}0.501{col 54}{space 4}-.8851326{col 67}{space 3} 1.807846
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
.         global rhs1 ="ln_poptot    lnhumanav   ln_dist   llngdppc lngdp_smp    rernlgdp   instm5i  l1lnresenbpval oilprice_usd2008 "
{txt}
{com}.         reg $lhs $ldv $rhs1, robust 

{txt}Linear regression                                      Number of obs ={res}     729
                                                       {txt}F( 10,   718) ={res}  281.29
                                                       {txt}Prob > F      = {res} 0.0000
                                                       {txt}R-squared     = {res} 0.8581
                                                       {txt}Root MSE      = {res} 1.0342

{txt}{hline 17}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 18}{c |}{col 30}    Robust
{col 1}        lnfdires{col 18}{c |}      Coef.{col 30}   Std. Err.{col 42}      t{col 50}   P>|t|{col 58}     [95% Con{col 71}f. Interval]
{hline 17}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 7}llnfdires {c |}{col 18}{res}{space 2} .8466955{col 30}{space 2} .0281614{col 41}{space 1}   30.07{col 50}{space 3}0.000{col 58}{space 4}  .791407{col 71}{space 3}  .901984
{txt}{space 7}ln_poptot {c |}{col 18}{res}{space 2} .0735975{col 30}{space 2} .0328478{col 41}{space 1}    2.24{col 50}{space 3}0.025{col 58}{space 4} .0091084{col 71}{space 3} .1380866
{txt}{space 7}lnhumanav {c |}{col 18}{res}{space 2} .3799685{col 30}{space 2} .1567685{col 41}{space 1}    2.42{col 50}{space 3}0.016{col 58}{space 4} .0721891{col 71}{space 3} .6877479
{txt}{space 9}ln_dist {c |}{col 18}{res}{space 2}-.1488164{col 30}{space 2}  .073204{col 41}{space 1}   -2.03{col 50}{space 3}0.042{col 58}{space 4}-.2925359{col 71}{space 3}-.0050968
{txt}{space 8}llngdppc {c |}{col 18}{res}{space 2}-.1652409{col 30}{space 2} .0819887{col 41}{space 1}   -2.02{col 50}{space 3}0.044{col 58}{space 4}-.3262072{col 71}{space 3}-.0042746
{txt}{space 7}lngdp_smp {c |}{col 18}{res}{space 2}-.0961012{col 30}{space 2} .1372713{col 41}{space 1}   -0.70{col 50}{space 3}0.484{col 58}{space 4}-.3656023{col 71}{space 3} .1733999
{txt}{space 8}rernlgdp {c |}{col 18}{res}{space 2} -.062627{col 30}{space 2} .0311006{col 41}{space 1}   -2.01{col 50}{space 3}0.044{col 58}{space 4} -.123686{col 71}{space 3}-.0015681
{txt}{space 9}instm5i {c |}{col 18}{res}{space 2} .0202858{col 30}{space 2} .0100906{col 41}{space 1}    2.01{col 50}{space 3}0.045{col 58}{space 4} .0004753{col 71}{space 3} .0400964
{txt}{space 2}l1lnresenbpval {c |}{col 18}{res}{space 2} .0288878{col 30}{space 2} .0158031{col 41}{space 1}    1.83{col 50}{space 3}0.068{col 58}{space 4}-.0021381{col 71}{space 3} .0599136
{txt}oilprice_usd2008 {c |}{col 18}{res}{space 2}-.0039313{col 30}{space 2}   .00536{col 41}{space 1}   -0.73{col 50}{space 3}0.464{col 58}{space 4}-.0144544{col 71}{space 3} .0065918
{txt}{space 11}_cons {c |}{col 18}{res}{space 2} 2.058755{col 30}{space 2} 1.905025{col 41}{space 1}    1.08{col 50}{space 3}0.280{col 58}{space 4}-1.681331{col 71}{space 3}  5.79884
{txt}{hline 17}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. // Figure 2 & 3
. 
.         do "$path\simulation.do"
{txt}
{com}. 
. *************************************************************************
. *** simulation for non-resource FDI
. *************************************************************************
. preserve
{txt}
{com}. global lhs="lnfdinores"
{txt}
{com}. global clus =""
{txt}
{com}. global ldv= "llnfdinores"
{txt}
{com}. 
. global rhs1 ="ln_poptot  lnhumanav   ln_dist  llngdppc lngdp_smp  rernlgdp govshare l1lnresenval "
{txt}
{com}. qui reg $lhs $ldv $rhs1, robust
{txt}
{com}. keep if e(sample)
{txt}(3331 observations deleted)

{com}. sort year idcode
{txt}
{com}. qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}. subsave dij* using "$path\w.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w.dta saved

{com}. spatwmat using "$path\w.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}1085x1085


{txt}
{com}. matrix eigenvalues re im = w
{txt}
{com}. matrix e = re'  
{txt}
{com}. spatreg2 $lhs $ldv $rhs1 $extra, robust  w(w) e(e) model(lag) vce($clus)
{res}
{txt}initial:       log pseudolikelihood = {res}-975.78486
{txt}rescale:       log pseudolikelihood = {res}-975.78486
{txt}rescale eq:    log pseudolikelihood = {res}-975.78486
{txt}Iteration 0:{col 16}log pseudolikelihood = {res}-975.78486{txt}  
Iteration 1:{col 16}log pseudolikelihood = {res}-962.98705{txt}  
Iteration 2:{col 16}log pseudolikelihood = {res}-962.74339{txt}  
Iteration 3:{col 16}log pseudolikelihood = {res}-962.74312{txt}  
Iteration 4:{col 16}log pseudolikelihood = {res}-962.74312{txt}  
{res}

{txt}Weights matrix
 Name: {res}w
{txt} Type: {res}Imported (non-binary)
{txt} Row-standardized: {res}No


{txt}Spatial lag model{col 52}Number of obs{col 68}={res}      1085
{txt}{col 52}Variance ratio{col 68}={res}     0.965
{txt}{col 52}Squared corr.{col 68}={res}     0.965
{txt}Log likelihood = {res}-962.74312{txt}{col 52}Sigma{col 68}={res}      0.59

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  lnfdinores{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}lnfdinores   {txt}{c |}
{space 1}llnfdinores {c |}{col 14}{res}{space 2} .8312982{col 26}{space 2} .0343886{col 37}{space 1}   24.17{col 46}{space 3}0.000{col 54}{space 4} .7638979{col 67}{space 3} .8986985
{txt}{space 3}ln_poptot {c |}{col 14}{res}{space 2} .1683948{col 26}{space 2} .0355587{col 37}{space 1}    4.74{col 46}{space 3}0.000{col 54}{space 4} .0987012{col 67}{space 3} .2380885
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} .3717783{col 26}{space 2} .0934772{col 37}{space 1}    3.98{col 46}{space 3}0.000{col 54}{space 4} .1885663{col 67}{space 3} .5549903
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2}-.1806757{col 26}{space 2} .0474096{col 37}{space 1}   -3.81{col 46}{space 3}0.000{col 54}{space 4}-.2735968{col 67}{space 3}-.0877546
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2} .0988684{col 26}{space 2} .0425714{col 37}{space 1}    2.32{col 46}{space 3}0.020{col 54}{space 4} .0154299{col 67}{space 3} .1823068
{txt}{space 3}lngdp_smp {c |}{col 14}{res}{space 2}-.3036563{col 26}{space 2} .0980824{col 37}{space 1}   -3.10{col 46}{space 3}0.002{col 54}{space 4}-.4958942{col 67}{space 3}-.1114184
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2}-.1049584{col 26}{space 2} .0264389{col 37}{space 1}   -3.97{col 46}{space 3}0.000{col 54}{space 4}-.1567777{col 67}{space 3}-.0531392
{txt}{space 4}govshare {c |}{col 14}{res}{space 2}-.0093416{col 26}{space 2} .0030195{col 37}{space 1}   -3.09{col 46}{space 3}0.002{col 54}{space 4}-.0152597{col 67}{space 3}-.0034236
{txt}l1lnresenval {c |}{col 14}{res}{space 2}-.0214188{col 26}{space 2} .0086733{col 37}{space 1}   -2.47{col 46}{space 3}0.014{col 54}{space 4}-.0384181{col 67}{space 3}-.0044195
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 1.262824{col 26}{space 2} .8622188{col 37}{space 1}    1.46{col 46}{space 3}0.143{col 54}{space 4}-.4270939{col 67}{space 3} 2.952742
{txt}{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
         rho {c |}  {res} .1498836   .0346113     4.33   0.000{col 58} .0820468    .2177205
{txt}{hline 13}{c BT}{hline 64}
Wald test of rho=0:{col 40}chi2(1) = {res}{col 50} 18.753{txt} ({res}0.000{txt})
Lagrange multiplier test of rho=0:{col 40}chi2(1) = {res}{col 50} 27.494{txt} ({res}0.000{txt})
robust Lagrange multiplier test of rho=0:{col 50}chi2(1) = {res}{col 60} 19.003{txt} ({res}0.000{txt})
robust Lagrange multiplier test of lambda=0:{col 50}chi2(1) = {res}{col 60}  5.125{txt} ({res}0.024{txt})

Acceptable range for rho: {res}-3.261 < rho < 1.000


{txt}
{com}. 
. 
. drop if longitude==.
{txt}(0 observations deleted)

{com}. replace year =1 
{txt}(1085 real changes made)

{com}. 
. keep idcode country year longitude latitude lnfdinores
{txt}
{com}. duplicates drop idcode, force

{p 0 4}{txt}Duplicates in terms of {res} idcode{p_end}

{txt}(1014 observations deleted)

{com}. qui do "$path\weight matrix calculation rowst.do"
{txt}
{com}. subsave dij* using "$path\w.dta", replace
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\w.dta saved

{com}. spatwmat using "$path\w.dta", name(w)


{txt}The following matrix has been created:

1. Imported non-binary weights matrix {res}w{txt} 
   Dimension: {res}71x71


{txt}
{com}. 
. 
. 
. *****
. *** calculate long run effects: 
. *****
. sort year idcode 
{txt}
{com}. gen fdinores=exp(lnfdinores)
{txt}
{com}. mkmat fdinores, mat(fdi)
{res}{txt}
{com}. mata
{txt}{hline 49} mata (type {cmd:end} to exit) {hline}
{com}:         fdi=st_matrix("fdi")
{res}
{com}:         W=st_matrix("w")
{res}
{com}:         A=qrinv(I(rows(W)) -.1498836*W )
{res}
{com}:         L= -.0214188* A * qrinv( I(rows(W)) -.8312982*A )
{res}
{com}:         st_matrix("L", L)
{res}
{com}:         
:         Lmin=rowmin(L)
{res}
{com}:         Ltot=colsum(L:*fdi:*100)
{res}
{com}:         Ltot=Ltot'
{res}
{com}:         st_matrix("Lmin", Lmin)
{res}
{com}:         st_matrix("Ltot", Ltot)
{res}
{com}:         st_matrix("A", A)
{res}
{com}: end
{txt}{hline}

{com}. 
. svmat Lmin
{txt}
{com}. svmat Ltot
{txt}
{com}. egen fditot=total(fdinores)
{txt}
{com}. gen x= Lmin* fdinores*100
{txt}
{com}. gen row=Ltot-x
{txt}
{com}. gen rowshare=  row/(fditot- fdinores)
{txt}
{com}. gen totshare=Ltot/fditot
{txt}
{com}. replace Lmin=Lmin*100
{txt}(71 real changes made)

{com}. hilo rowshare totshare Lmin  country fdinores, show(5)
{txt}5 lowest and highest observations on rowshare

  {c TLC}{hline 11}{c -}{hline 11}{c -}{hline 11}{c -}{hline 13}{c -}{hline 10}{c TRC}
  {c |} {res} rowshare    totshare       Lmin1       country   fdinores {txt}{c |}
  {c LT}{hline 11}{c -}{hline 11}{c -}{hline 11}{c -}{hline 13}{c -}{hline 10}{c RT}
  {c |} {res}-3.137402   -4.799517   -15.63196   Switzerland   3588.435 {txt}{c |}
  {c |} {res}-3.051188   -4.684557   -15.54906       Germany   3525.441 {txt}{c |}
  {c |} {res}-2.924711   -3.206108   -15.31135         Italy   612.8192 {txt}{c |}
  {c |} {res}-2.855108   -2.977288   -15.43503       Austria   261.9899 {txt}{c |}
  {c |} {res}-2.843558   -4.215922   -15.30415       Belgium   2970.952 {txt}{c |}
  {c BLC}{hline 11}{c -}{hline 11}{c -}{hline 11}{c -}{hline 13}{c -}{hline 10}{c BRC}

  {c TLC}{hline 11}{c -}{hline 11}{c -}{hline 11}{c -}{hline 18}{c -}{hline 10}{c TRC}
  {c |} {res} rowshare    totshare       Lmin1            country   fdinores {txt}{c |}
  {c LT}{hline 11}{c -}{hline 11}{c -}{hline 11}{c -}{hline 18}{c -}{hline 10}{c RT}
  {c |} {res}-.7067906   -.7659369   -13.49887          Indonesia   124.7244 {txt}{c |}
  {c |} {res}-.5819716   -4.419412   -13.30133      United States   8138.445 {txt}{c |}
  {c |} {res}-.5719814   -.5752158   -13.29064   Papua New Guinea   6.859884 {txt}{c |}
  {c |} {res}-.5147431   -.6550689     -13.266          Australia   296.8585 {txt}{c |}
  {c |} {res} -.486724   -.4993753   -13.20729        New Zealand   26.82825 {txt}{c |}
  {c BLC}{hline 11}{c -}{hline 11}{c -}{hline 11}{c -}{hline 18}{c -}{hline 10}{c BRC}

{com}. 
. 
. 
. 
. ******************************************
. ** simulation
. ******************************************
. mat a = inv(I(rowsof(w))-.1498836*w)
{txt}
{com}. 
. ** Australia: 
. gen shocka = 0
{txt}
{com}. replace shocka = 17.722044 if country =="Australia"
{txt}(1 real change made)

{com}. mkmat shocka, mat(sa)
{res}{txt}
{com}. mat xa = a* -.0214188*sa
{txt}
{com}. 
. mat ya1 = a*.8312982*(xa)
{txt}
{com}. svmat ya1
{txt}
{com}. renvars ya1, postdrop(1)
{txt}
{com}. 
. local i =2
{txt}
{com}. while `i'<=50 {c -(}
{txt}  2{com}. local j = `i'-1
{txt}  3{com}. mat ya`i' = a*.8312982*ya`j'
{txt}  4{com}. svmat ya`i', names(ya`i')
{txt}  5{com}. renvars ya`i', postdrop(1)
{txt}  6{com}. local i=`i'+1
{txt}  7{com}. {c )-}
{txt}
{com}. 
. 
. ** Norway:
. 
. gen shockb = 0
{txt}
{com}. replace shockb = 17.722044 if country =="Norway"
{txt}(1 real change made)

{com}. mkmat shockb, mat(sb)
{res}{txt}
{com}. mat xb = a* -.0214188*sb
{txt}
{com}. 
. 
. mat yb1 = a*.8312982*(xb)
{txt}
{com}. svmat yb1
{txt}
{com}. renvars yb1, postdrop(1)
{txt}
{com}. 
. local i =2
{txt}
{com}. while `i'<=50 {c -(}
{txt}  2{com}. local j = `i'-1
{txt}  3{com}. mat yb`i' = a*.8312982*yb`j'
{txt}  4{com}. svmat yb`i', names(yb`i')
{txt}  5{com}. renvars yb`i', postdrop(1)
{txt}  6{com}. local i=`i'+1
{txt}  7{com}. {c )-}
{txt}
{com}. 
. drop longitude latitude shock* dij*
{txt}
{com}. 
. 
. 
. reshape long ya yb, i(idcode) j(years)
{txt}(note: j = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50)

Data{col 36}wide{col 43}->{col 48}long
{hline 77}
Number of obs.                 {res}      71   {txt}->{res}    3550
{txt}Number of variables            {res}     112   {txt}->{res}      15
{txt}j variable (50 values)                    ->   {res}years
{txt}xij variables:
                       {res}ya1 ya2 ... ya50   {txt}->   {res}ya
                       yb1 yb2 ... yb50   {txt}->   {res}yb
{txt}{hline 77}

{com}. tsset idcode years
{res}{txt}{col 8}panel variable:  {res}idcode (strongly balanced)
{txt}{col 9}time variable:  {res}{col 25}years, 1 to 50
{txt}{col 17}delta:  {res}1 unit
{txt}
{com}. label var years "Years after 1 sd increase in natural resource rents"
{txt}
{com}. 
. label var ya "with spillovers"
{txt}
{com}. label var yb "with spillovers"
{txt}
{com}. 
. 
. *** without spatial effects:
. sort country years
{txt}
{com}. gen y2=.
{txt}(3550 missing values generated)

{com}. label var y2 "without spillovers"
{txt}
{com}. 
. replace y2 = .8312982*(-.0214188*17.722044) if years==1
{txt}(71 real changes made)

{com}. 
. local i =2
{txt}
{com}. while `i'<=50 {c -(}
{txt}  2{com}. replace y2 = .8312982*y2[_n-1] if years==`i'
{txt}  3{com}. local i = `i'+1
{txt}  4{com}. {c )-}
{txt}(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)
(71 real changes made)

{com}. 
. *** effects on rest of the world
. sort years idcode
{txt}
{com}. by years: egen yarow=total(ya) if country!="Australia"
{txt}(50 missing values generated)

{com}. label var yarow "Rest of the World"
{txt}
{com}. by years: egen ybrow=total(yb) if country!="Norway"
{txt}(50 missing values generated)

{com}. label var ybrow "Rest of the World"
{txt}
{com}. 
. twoway (line ya years if country == "Australia", lcolor(black) lpattern(solid) lwidth(medthick)) (line y2 years if country == "Australia", lcolor(black) lpattern(dash) lwidth(medthick)) (line yarow years if country=="Norway", lcolor(black) lpattern(dot) lwidth(medthick)), name(aus, replace)  legend(rows(1)) nodraw title("Australia") ylabel(,grid)
{res}{txt}
{com}. twoway (line yb years if country == "Norway", lcolor(black) lpattern(solid) lwidth(medthick)) (line y2 years if country == "Norway", lcolor(black) lpattern(dash) lwidth(medthick)) (line ybrow years if country=="Australia", lcolor(black) lpattern(dot) lwidth(medthick)), name(bel, replace)  legend(rows(1)) nodraw title("Norway") ylabel(,grid)
{res}{txt}
{com}. grc1leg aus bel, ycommon rows(1) title("Effect on ln Non-Resource FDI") legend(aus)
{res}{txt}
{com}. graph save "$path\figure2" , asis replace 
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\figure2.gph saved

{com}. 
. 
. 
. *** add the effect of a shock to resource fdi
. sort country years
{txt}
{com}. gen yr=.
{txt}(3550 missing values generated)

{com}. label var yr "resource FDI"
{txt}
{com}. 
. replace yr = 0.8520112*(0.0307566*17.722044) if years==1
{txt}(71 real changes made)

{com}. 
. local i =2
{txt}
{com}. qui while `i'<=50 {c -(}
{txt}
{com}. gen yrnor =yr
{txt}
{com}. replace yrnor=0 if country!="Norway"
{txt}(3500 real changes made)

{com}. gen yraus =yr
{txt}
{com}. replace yraus=0 if country!="Australia"
{txt}(3500 real changes made)

{com}. 
. local i =1
{txt}
{com}. qui while `i' <=50 {c -(}
{txt}
{com}. 
. local i =1
{txt}
{com}. qui while `i' <=50 {c -(}
{txt}
{com}. 
. gen ytotalaus = ya+yarow 
{txt}
{com}. label var ytotalaus "non-resource FDI"
{txt}
{com}. gen ytotalnor = yb+ybrow 
{txt}
{com}. label var ytotalnor "non-resource FDI"
{txt}
{com}. 
. gen ysumaus = ytotalaus+yraus
{txt}
{com}. label var ysumaus "Total FDI"
{txt}
{com}. gen ysumnor = ytotalnor+yrnor
{txt}
{com}. label var ysumnor "Total FDI"
{txt}
{com}. 
. twoway (line ysumaus years if country=="Australia", lcolor(black) lpattern(solid) lwidth(medthick)) (line ytotalaus years if country == "Australia", lcolor(black) lpattern(dash) lwidth(medthick)) (line yr years if country=="Australia", lcolor(black) lpattern(dot) lwidth(medthick)) , name(aus2, replace)  legend(rows(1)) nodraw title("Australia") ylabel(,grid)
{res}{txt}
{com}. twoway (line ysumnor years if country == "Norway", lcolor(black) lpattern(solid) lwidth(medthick)) (line ytotalnor years if country == "Norway", lcolor(black) lpattern(dash) lwidth(medthick)) (line yr years if country == "Norway", lcolor(black) lpattern(dot) lwidth(medthick)) , name(nor2, replace)  legend(rows(1)) nodraw title("Norway") ylabel(,grid)
{res}{txt}
{com}. grc1leg aus2 nor2, ycommon rows(1) title("Effect on World FDI") legend(aus2)
{res}{txt}
{com}. graph save "$path\figure3" , asis replace 
{txt}file H:\DNB\met Rick Dutch FDI\REStat replication\figure3.gph saved

{com}. 
. restore
{txt}
{com}. 
. 
. 
. 
. 
. 
. 
. 
. 
{txt}end of do-file

{com}. 
. // Table A2
. 
.                 global rhs1 ="ln_poptot   lnhumanav   ln_dist  trend  llngdppc lngdp_smp  rernlgdp govshare  "
{txt}
{com}.                 global sel = "openness  landlock "
{txt}
{com}.         preserve
{txt}
{com}.                 gen s= .
{txt}(4416 missing values generated)

{com}.                 replace s =1 if fdinores!=0 & fdinores!=.
{txt}(2754 real changes made)

{com}.                 replace s =0 if fdinores==0 
{txt}(723 real changes made)

{com}.                 qui probit s $rhs1 $sel l1restotdum, robust
{txt}
{com}. 
.                 sum lnfdinores lnfdires ln_poptot openness lnhumanav   ln_dist  llngdppc lngdp_smp ftaned gattwtodum landlock l1restotdum l1resendum l1resnotendum l1lnresenval l1lnresnotenval l1lnresenbpval oilprice_usd2008 instm5i rernlgdp govshare if e(sample)

{txt}    Variable {c |}       Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 56}
{space 2}lnfdinores {c |}{res}      1607    3.894074    3.167514  -16.74539   11.29823
{txt}{space 4}lnfdires {c |}{res}      1330    2.819985    3.254218  -7.160852   9.645416
{txt}{space 3}ln_poptot {c |}{res}      1842    9.330492    1.577074    5.47496   14.06172
{txt}{space 4}openness {c |}{res}      1842    .6188925    .4857908          0          1
{txt}{space 3}lnhumanav {c |}{res}      1842     1.48919    .6906591  -1.005122   2.505281
{txt}{hline 13}{c +}{hline 56}
{space 5}ln_dist {c |}{res}      1842    8.447517     .967475   4.748237   9.807966
{txt}{space 4}llngdppc {c |}{res}      1842    8.514013     1.12761   5.139058   10.44478
{txt}{space 3}lngdp_smp {c |}{res}      1842    6.564015    .4953767   5.456325   8.128095
{txt}{space 6}ftaned {c |}{res}      1842    .1693811      .37519          0          1
{txt}{space 2}gattwtodum {c |}{res}      1842    .1715527    .3770935          0          1
{txt}{hline 13}{c +}{hline 56}
{space 4}landlock {c |}{res}      1842    .1807818    .3849418          0          1
{txt}{space 1}l1restotdum {c |}{res}      1842    .8235613    .3812965          0          1
{txt}{space 2}l1resendum {c |}{res}      1842    .6606949    .4736021          0          1
{txt}l1resnoten~m {c |}{res}      1842     .728013     .445104          0          1
{txt}l1lnresenval {c |}{res}      1217    19.53327    3.432905   6.813958   26.26045
{txt}{hline 13}{c +}{hline 56}
l1lnresnot~l {c |}{res}      1341    17.48925    2.975615   7.588418   23.14146
{txt}l1lnresenb~l {c |}{res}      1034    9.027144    2.552473   .8415672   14.22462
{txt}oilpric~2008 {c |}{res}      1842    31.65486    9.915435      17.32      58.27
{txt}{space 5}instm5i {c |}{res}      1601    22.55853    7.198833       4.08         38
{txt}{space 4}rernlgdp {c |}{res}      1842     .578139    .6263853    .110981    12.4901
{txt}{hline 13}{c +}{hline 56}
{space 4}govshare {c |}{res}      1842    20.30701    8.545101   2.462915   58.13906
{txt}
{com}.         restore
{txt}
{com}. 
. 
. 
. // PPML estimates
. 
.         gen fdinores0pos = .
{txt}(4416 missing values generated)

{com}.         replace fdinores0pos=fdinores if lnfdinores!=.
{txt}(2531 real changes made)

{com}.         replace fdinores0pos=0 if fdinores!=. & lnfdinores==.
{txt}(946 real changes made)

{com}.         global rhs1 ="ln_poptot    lnhumanav   ln_dist trend llngdppc lngdp_smp   rernlgdp govshare  "
{txt}
{com}.         glm fdinores0pos $rhs1 l1lnresenval ,robust family(poisson) link(log) irls mu(fdinores0pos)
{txt}note: fdinores0pos has noninteger values

Iteration 1:{col 16}deviance = {res} 514012.8
{txt}Iteration 2:{col 16}deviance = {res} 425797.3
{txt}Iteration 3:{col 16}deviance = {res} 421148.1
{txt}Iteration 4:{col 16}deviance = {res} 421114.4
{txt}Iteration 5:{col 16}deviance = {res} 421114.4
{txt}Iteration 6:{col 16}deviance = {res} 421114.4

{txt}Generalized linear models{col 52}No. of obs{col 68}={col 70}{res}     1283
{txt}Optimization     : {res}MQL Fisher scoring{txt}{col 52}Residual df{col 68}={col 70}{res}     1273
{col 20}(IRLS EIM){txt}{col 52}Scale parameter{col 68}={col 70}{res}        1
{txt}Deviance{col 18}={res}{col 20} 421114.3644{txt}{col 52}(1/df) Deviance{col 68}={res}{col 70} 330.8047
{txt}Pearson{col 18}={res}{col 20} 462998.3758{txt}{col 52}(1/df) Pearson{col 68}={res}{col 70} 363.7065

{txt}Variance function: {res}V(u) = {col 27}u{col 52}{txt}[{res}Poisson{txt}]
Link function    : {res}g(u) = {col 27}ln(u){col 52}{txt}[{res}Log{txt}]

{col 52}BIC{col 68}={res}{col 70} 412003.6

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}fdinores0pos{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}ln_poptot {c |}{col 14}{res}{space 2} .7301437{col 26}{space 2} .0377163{col 37}{space 1}   19.36{col 46}{space 3}0.000{col 54}{space 4} .6562211{col 67}{space 3} .8040664
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} .7376652{col 26}{space 2} .1577864{col 37}{space 1}    4.68{col 46}{space 3}0.000{col 54}{space 4} .4284096{col 67}{space 3} 1.046921
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2}-1.462163{col 26}{space 2} .0564159{col 37}{space 1}  -25.92{col 46}{space 3}0.000{col 54}{space 4}-1.572737{col 67}{space 3} -1.35159
{txt}{space 7}trend {c |}{col 14}{res}{space 2} .1418468{col 26}{space 2} .0081141{col 37}{space 1}   17.48{col 46}{space 3}0.000{col 54}{space 4} .1259435{col 67}{space 3} .1577501
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2} 1.285995{col 26}{space 2} .0874687{col 37}{space 1}   14.70{col 46}{space 3}0.000{col 54}{space 4} 1.114559{col 67}{space 3}  1.45743
{txt}{space 3}lngdp_smp {c |}{col 14}{res}{space 2}-2.235381{col 26}{space 2} .1493935{col 37}{space 1}  -14.96{col 46}{space 3}0.000{col 54}{space 4}-2.528187{col 67}{space 3}-1.942575
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2}-.6992996{col 26}{space 2} .2001951{col 37}{space 1}   -3.49{col 46}{space 3}0.000{col 54}{space 4}-1.091675{col 67}{space 3}-.3069245
{txt}{space 4}govshare {c |}{col 14}{res}{space 2}-.1012319{col 26}{space 2}  .009386{col 37}{space 1}  -10.79{col 46}{space 3}0.000{col 54}{space 4}-.1196282{col 67}{space 3}-.0828356
{txt}l1lnresenval {c |}{col 14}{res}{space 2}-.1162359{col 26}{space 2} .0137261{col 37}{space 1}   -8.47{col 46}{space 3}0.000{col 54}{space 4}-.1431386{col 67}{space 3}-.0893332
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 15.18983{col 26}{space 2} 1.824421{col 37}{space 1}    8.33{col 46}{space 3}0.000{col 54}{space 4} 11.61404{col 67}{space 3} 18.76563
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}.         global rhs1 ="ln_poptot  openness  lnhumanav   ln_dist  trend  llngdppc lngdp_smp ftaned gattwtodum landlock rernlgdp govshare instm5i l1restotdum"
{txt}
{com}.         glm fdinores0pos $rhs1 ,robust family(poisson) link(log) irls mu(fdinores0pos)
{txt}note: fdinores0pos has noninteger values

Iteration 1:{col 16}deviance = {res} 781878.4
{txt}Iteration 2:{col 16}deviance = {res} 582207.3
{txt}Iteration 3:{col 16}deviance = {res} 551828.7
{txt}Iteration 4:{col 16}deviance = {res} 549703.5
{txt}Iteration 5:{col 16}deviance = {res} 549682.4
{txt}Iteration 6:{col 16}deviance = {res} 549682.4
{txt}Iteration 7:{col 16}deviance = {res} 549682.4

{txt}Generalized linear models{col 52}No. of obs{col 68}={col 70}{res}     1601
{txt}Optimization     : {res}MQL Fisher scoring{txt}{col 52}Residual df{col 68}={col 70}{res}     1586
{col 20}(IRLS EIM){txt}{col 52}Scale parameter{col 68}={col 70}{res}        1
{txt}Deviance{col 18}={res}{col 20} 549682.4461{txt}{col 52}(1/df) Deviance{col 68}={res}{col 70} 346.5841
{txt}Pearson{col 18}={res}{col 20} 688257.3675{txt}{col 52}(1/df) Pearson{col 68}={res}{col 70}  433.958

{txt}Variance function: {res}V(u) = {col 27}u{col 52}{txt}[{res}Poisson{txt}]
Link function    : {res}g(u) = {col 27}ln(u){col 52}{txt}[{res}Log{txt}]

{col 52}BIC{col 68}={res}{col 70} 537980.3

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}fdinores0pos{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      z{col 46}   P>|z|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}ln_poptot {c |}{col 14}{res}{space 2}  .570846{col 26}{space 2} .0336277{col 37}{space 1}   16.98{col 46}{space 3}0.000{col 54}{space 4} .5049369{col 67}{space 3} .6367552
{txt}{space 4}openness {c |}{col 14}{res}{space 2} 1.079225{col 26}{space 2}  .164034{col 37}{space 1}    6.58{col 46}{space 3}0.000{col 54}{space 4} .7577239{col 67}{space 3} 1.400726
{txt}{space 3}lnhumanav {c |}{col 14}{res}{space 2} .3142777{col 26}{space 2} .1557005{col 37}{space 1}    2.02{col 46}{space 3}0.044{col 54}{space 4} .0091104{col 67}{space 3}  .619445
{txt}{space 5}ln_dist {c |}{col 14}{res}{space 2}-1.544198{col 26}{space 2} .0704404{col 37}{space 1}  -21.92{col 46}{space 3}0.000{col 54}{space 4}-1.682258{col 67}{space 3}-1.406137
{txt}{space 7}trend {c |}{col 14}{res}{space 2} .1603279{col 26}{space 2} .0081347{col 37}{space 1}   19.71{col 46}{space 3}0.000{col 54}{space 4} .1443842{col 67}{space 3} .1762715
{txt}{space 4}llngdppc {c |}{col 14}{res}{space 2} 1.245502{col 26}{space 2} .1045082{col 37}{space 1}   11.92{col 46}{space 3}0.000{col 54}{space 4} 1.040669{col 67}{space 3} 1.450334
{txt}{space 3}lngdp_smp {c |}{col 14}{res}{space 2}-2.297026{col 26}{space 2} .1613893{col 37}{space 1}  -14.23{col 46}{space 3}0.000{col 54}{space 4}-2.613343{col 67}{space 3}-1.980709
{txt}{space 6}ftaned {c |}{col 14}{res}{space 2}-.0425697{col 26}{space 2} .1640778{col 37}{space 1}   -0.26{col 46}{space 3}0.795{col 54}{space 4}-.3641563{col 67}{space 3} .2790169
{txt}{space 2}gattwtodum {c |}{col 14}{res}{space 2} .6327482{col 26}{space 2} .1514797{col 37}{space 1}    4.18{col 46}{space 3}0.000{col 54}{space 4} .3358534{col 67}{space 3}  .929643
{txt}{space 4}landlock {c |}{col 14}{res}{space 2} .8173526{col 26}{space 2} .1277373{col 37}{space 1}    6.40{col 46}{space 3}0.000{col 54}{space 4} .5669921{col 67}{space 3} 1.067713
{txt}{space 4}rernlgdp {c |}{col 14}{res}{space 2}-.4332338{col 26}{space 2} .1670957{col 37}{space 1}   -2.59{col 46}{space 3}0.010{col 54}{space 4}-.7607353{col 67}{space 3}-.1057324
{txt}{space 4}govshare {c |}{col 14}{res}{space 2}-.0925664{col 26}{space 2} .0102341{col 37}{space 1}   -9.04{col 46}{space 3}0.000{col 54}{space 4}-.1126249{col 67}{space 3}-.0725078
{txt}{space 5}instm5i {c |}{col 14}{res}{space 2} .0003367{col 26}{space 2} .0079799{col 37}{space 1}    0.04{col 46}{space 3}0.966{col 54}{space 4}-.0153037{col 67}{space 3} .0159771
{txt}{space 1}l1restotdum {c |}{col 14}{res}{space 2}-.5449252{col 26}{space 2} .1449141{col 37}{space 1}   -3.76{col 46}{space 3}0.000{col 54}{space 4}-.8289515{col 67}{space 3}-.2608989
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 15.59484{col 26}{space 2} 2.013677{col 37}{space 1}    7.74{col 46}{space 3}0.000{col 54}{space 4}  11.6481{col 67}{space 3} 19.54157
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. 
. 
. 
. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}H:\DNB\met Rick Dutch FDI\REStat replication\output.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 2 Aug 2013, 16:40:54
{txt}{.-}
{smcl}
{txt}{sf}{ul off}